diff --git a/ChangeLog b/ChangeLog index bdfe6394c..1e18a8641 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-12-14 Vladimir Serbinenko + + * util/config.c: Remove trailing newline from distributor in simple + parsing. + 2013-12-14 Vladimir Serbinenko * include/grub/efi/api.h: Rename protocol and interface to avoid diff --git a/util/config.c b/util/config.c index e7474c6d1..ebcdd8f5e 100644 --- a/util/config.c +++ b/util/config.c @@ -52,8 +52,14 @@ grub_util_parse_config (FILE *f, struct grub_util_config *cfg, int simple) if (simple) { + char *ptr2; free (cfg->grub_distributor); cfg->grub_distributor = xstrdup (ptr); + for (ptr2 = cfg->grub_distributor + + grub_strlen (cfg->grub_distributor) - 1; + ptr2 >= cfg->grub_distributor + && (*ptr2 == '\r' || *ptr2 == '\n'); ptr2--); + ptr2[1] = '\0'; continue; } free (cfg->grub_distributor);