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