* grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Escape commas.
This commit is contained in:
parent
eb6d0dd3a1
commit
436575581e
2 changed files with 15 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue