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

This fixes a bug introduced by 0c674ce5f2.

Fixes #22004.
This commit is contained in:
Yu Watanabe
2022-01-05 12:15:24 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent e28df39269
commit e37d30f334
+2 -2
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;
}