From eb6d0dd3a135cde0d2212f1b8c57ffbe419cfe48 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 20 Jun 2012 23:33:34 +0200 Subject: [PATCH] * grub-core/kern/main.c (grub_set_prefix_and_root): Skip escaped commas when looking for partition separator. --- ChangeLog | 5 +++++ grub-core/kern/main.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc8b21c1e..26b2ceab2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-06-20 Vladimir Serbinenko + + * grub-core/kern/main.c (grub_set_prefix_and_root): Skip escaped commas + when looking for partition separator. + 2012-06-20 Vladimir Serbinenko * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_encode_devname): diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c index 185230c5c..de9ba927e 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -141,8 +141,18 @@ grub_set_prefix_and_root (void) /* We have a partition, but still need to fill in the drive. */ char *comma, *new_device; - comma = grub_strchr (fwdevice, ','); - if (comma) + for (comma = fwdevice; *comma; ) + { + if (comma[0] == '\\' && comma[1] == ',') + { + comma += 2; + continue; + } + if (*comma == ',') + break; + comma++; + } + if (*comma) { char *drive = grub_strndup (fwdevice, comma - fwdevice); new_device = grub_xasprintf ("%s%s", drive, device);