From: Jan Janssen Date: Sat, 3 Sep 2022 22:22:23 +0000 (+0200) Subject: boot: Correctly handle @saved default patterns X-Git-Tag: v253-rc1~518^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7941f11acb67c4f8ec857a791a51f3148af67b32;p=thirdparty%2Fsystemd.git boot: Correctly handle @saved default patterns --- diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index b88d42fdc18..40dc88f8dcc 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -994,6 +994,12 @@ static int boot_config_find(const BootConfig *config, const char *id) { if (!id) return -1; + if (id[0] == '@') { + if (!strcaseeq(id, "@saved")) + return -1; + id = config->entry_selected; + } + for (size_t i = 0; i < config->n_entries; i++) if (fnmatch(id, config->entries[i].id, FNM_CASEFOLD) == 0) return i;