From 47a77af5e8f03eed1edb60f81ab7764d54ab515a Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 10 Jan 2011 19:25:00 +0100 Subject: [PATCH] * grub-core/commands/legacycfg.c (legacy_file): Trim the line. --- ChangeLog | 4 ++++ grub-core/commands/legacycfg.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 64f9a5be9..6461f79f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-01-10 Vladimir Serbinenko + + * grub-core/commands/legacycfg.c (legacy_file): Trim the line. + 2011-01-10 Vladimir Serbinenko * util/grub-menulst2cfg.c (main): Trim the line. diff --git a/grub-core/commands/legacycfg.c b/grub-core/commands/legacycfg.c index de392ac81..71ac5c620 100644 --- a/grub-core/commands/legacycfg.c +++ b/grub-core/commands/legacycfg.c @@ -83,9 +83,13 @@ legacy_file (const char *filename) { char *oldname = NULL; char *newsuffix; + char *ptr; + + for (ptr = buf; *ptr && grub_isspace (*ptr); ptr++); oldname = entryname; - parsed = grub_legacy_parse (buf, &entryname, &newsuffix); + parsed = grub_legacy_parse (ptr, &entryname, &newsuffix); + grub_free (buf); buf = NULL; if (newsuffix) {