* util/config.c: Remove trailing newline from distributor in simple

parsing.
This commit is contained in:
Vladimir Serbinenko 2013-12-14 21:50:36 +01:00
parent 607a39f9f0
commit 954c723acc
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2013-12-14 Vladimir Serbinenko <phcoder@gmail.com>
* util/config.c: Remove trailing newline from distributor in simple
parsing.
2013-12-14 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/efi/api.h: Rename protocol and interface to avoid

View file

@ -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);