15a207
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
15a207
From: Will Thompson <wjt@endlessm.com>
15a207
Date: Thu, 12 Jul 2018 10:38:27 +0100
15a207
Subject: [PATCH] blscfg: fix filename in "no 'linux' key" error
15a207
15a207
In find_entry(), 'filename' is either NULL or a directory in the ESP.
15a207
But previously it was passed to create_entry(), which uses it in an
15a207
error message as if it's the filename of the BLS entry in question.
15a207
15a207
Since bls_entry now has a 'filename' field, just use that.
15a207
15a207
Signed-off-by: Will Thompson <wjt@endlessm.com>
15a207
---
15a207
 grub-core/commands/blscfg.c | 6 +++---
15a207
 1 file changed, 3 insertions(+), 3 deletions(-)
15a207
15a207
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
15a207
index bd78559ef68..a45f40fe67e 100644
15a207
--- a/grub-core/commands/blscfg.c
15a207
+++ b/grub-core/commands/blscfg.c
15a207
@@ -514,7 +514,7 @@ static char **bls_make_list (struct bls_entry *entry, const char *key, int *num)
15a207
   return list;
15a207
 }
15a207
 
15a207
-static void create_entry (struct bls_entry *entry, const char *cfgfile)
15a207
+static void create_entry (struct bls_entry *entry)
15a207
 {
15a207
   int argc = 0;
15a207
   const char **argv = NULL;
15a207
@@ -539,7 +539,7 @@ static void create_entry (struct bls_entry *entry, const char *cfgfile)
15a207
   clinux = bls_get_val (entry, "linux", NULL);
15a207
   if (!clinux)
15a207
     {
15a207
-      grub_dprintf ("blscfg", "Skipping file %s with no 'linux' key.\n", cfgfile);
15a207
+      grub_dprintf ("blscfg", "Skipping file %s with no 'linux' key.\n", entry->filename);
15a207
       goto finish;
15a207
     }
15a207
 
15a207
@@ -753,7 +753,7 @@ static int find_entry (const char *filename,
15a207
 
15a207
   grub_dprintf ("blscfg", "%s Creating %d entries from bls\n", __func__, nentries);
15a207
   for (r = nentries - 1; r >= 0; r--)
15a207
-      create_entry(entries[r], filename);
15a207
+      create_entry(entries[r]);
15a207
 
15a207
   for (r = 0; r < nentries; r++)
15a207
       bls_free_entry (entries[r]);