diff --git a/src/boot/boot.c b/src/boot/boot.c index e1119589c9..eabfd6b6b2 100644 --- a/src/boot/boot.c +++ b/src/boot/boot.c @@ -1165,6 +1165,10 @@ static void boot_entry_parse_tries( if (!strcaseeq16(counter, suffix)) return; + entry->id = xasprintf("%.*ls%ls", + (int) prefix_len - 1, + file, + suffix); entry->tries_left = tries_left; entry->tries_done = tries_done; entry->directory = xstrdup16(directory); @@ -1395,13 +1399,16 @@ static void boot_entry_add_type1( } entry->device = device; - entry->id = xstrdup16(file); - strtolower16(entry->id); - - config_add_entry(config, entry); if (path) boot_entry_parse_tries(entry, path, file, u".conf"); + + if (!entry->id) + entry->id = xstrdup16(file); + + strtolower16(entry->id); + + config_add_entry(config, entry); TAKE_PTR(entry); }