1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-08 20:58:20 +03:00

sd-boot: select newest kernel entry matching with the default glob pattern

This fixes a bug introduced by 0c674ce5f24a6e52561ec6520e43a1ca45d90f01.

Fixes #22004.

(cherry picked from commit e37d30f334830fab4decd52ef3c17fa09b7b0d92)
This commit is contained in:
Yu Watanabe 2022-01-05 15:09:43 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent 7b2f8845cd
commit 0e29d6ef44

View File

@ -1638,9 +1638,9 @@ static INTN config_entry_find(Config *config, const CHAR16 *needle) {
if (!needle)
return -1;
for (UINTN i = 0; i < config->entry_count; i++)
for (INTN i = config->entry_count - 1; i >= 0; i--)
if (MetaiMatch(config->entries[i]->id, (CHAR16*) needle))
return (INTN) i;
return i;
return -1;
}