* grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Escape commas.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-06-20 23:37:24 +02:00
parent eb6d0dd3a1
commit 436575581e
2 changed files with 15 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2012-06-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Escape commas.
2012-06-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/main.c (grub_set_prefix_and_root): Skip escaped commas

View file

@ -265,10 +265,17 @@ grub_ofdisk_iterate (int (*hook) (const char *name),
continue;
{
char buffer[sizeof ("ieee1275/") + grub_strlen (ent->shortest)];
char *ptr;
ptr = grub_stpcpy (buffer, "ieee1275/");
grub_strcpy (ptr, ent->shortest);
char buffer[sizeof ("ieee1275/") + 2 * grub_strlen (ent->shortest)];
const char *iptr;
char *optr;
optr = grub_stpcpy (buffer, "ieee1275/");
for (iptr = ent->shortest; *iptr; iptr++)
{
if (*iptr == ',')
*optr++ = '\\';
*optr++ = *iptr++;
}
*optr = 0;
if (hook (buffer))
return 1;
}