* 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
|
@ -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…
Add table
Add a link
Reference in a new issue