diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-01-05 15:09:43 +0900 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-01-05 12:15:24 +0100 |
commit | e37d30f334830fab4decd52ef3c17fa09b7b0d92 (patch) | |
tree | 13a7786b89391b4ba0ae7d9d034a08cff8dc4ae3 /src | |
parent | e28df39269e03d49f540ebfe6b2e507d0f26c844 (diff) | |
download | systemd-e37d30f334830fab4decd52ef3c17fa09b7b0d92.tar.gz |
sd-boot: select newest kernel entry matching with the default glob pattern
This fixes a bug introduced by 0c674ce5f24a6e52561ec6520e43a1ca45d90f01.
Fixes #22004.
Diffstat (limited to 'src')
-rw-r--r-- | src/boot/efi/boot.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index 2c5bd913d2..9935f2e879 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -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; } |