420527a
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
420527a
From: Peter Jones <pjones@redhat.com>
420527a
Date: Thu, 11 Oct 2018 15:30:13 -0400
420527a
Subject: [PATCH] blscfg: don't include ".conf" at the end of our "id".
420527a
420527a
Related: rhbz#1638117
420527a
420527a
Signed-off-by: Peter Jones <pjones@redhat.com>
420527a
---
420527a
 grub-core/commands/blscfg.c | 11 +++++++++++
420527a
 1 file changed, 11 insertions(+)
420527a
420527a
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
420527a
index bec5a9ffe3e..3847572dabd 100644
420527a
--- a/grub-core/commands/blscfg.c
420527a
+++ b/grub-core/commands/blscfg.c
420527a
@@ -575,6 +575,7 @@ static void create_entry (struct bls_entry *entry)
420527a
   char **initrds = NULL;
420527a
   char *initrd = NULL;
420527a
   char *id = entry->filename;
420527a
+  char *dotconf = id;
420527a
   char *hotkey = NULL;
420527a
 
420527a
   char *users = NULL;
420527a
@@ -593,6 +594,16 @@ static void create_entry (struct bls_entry *entry)
420527a
       goto finish;
420527a
     }
420527a
 
420527a
+  /*
420527a
+   * strip the ".conf" off the end before we make it our "id" field.
420527a
+   */
420527a
+  do
420527a
+    {
420527a
+      dotconf = grub_strstr(dotconf, ".conf");
420527a
+    } while (dotconf != NULL && dotconf[5] != '\0');
420527a
+  if (dotconf)
420527a
+    dotconf[0] = '\0';
420527a
+
420527a
   title = bls_get_val (entry, "title", NULL);
420527a
   options = expand_val (bls_get_val (entry, "options", NULL));
420527a
   initrds = bls_make_list (entry, "initrd", NULL);