aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_capsule.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt2022-12-29 14:44:05 +0100
committerHeinrich Schuchardt2023-01-04 13:17:42 +0100
commit93cdb952382b3fa0110245e1fa34dadd7a52df45 (patch)
tree9236721ea553defb408d3083d15edc7e680bc8d2 /lib/efi_loader/efi_capsule.c
parent07355760b1759cc4c8cee402a67f7089b6a06da9 (diff)
efi_loader: adjust sorting of capsules
Up to now we only compared the first letter of the capsule name to sort them alphabetically. Properly sort by the Unicode alphabet. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib/efi_loader/efi_capsule.c')
-rw-r--r--lib/efi_loader/efi_capsule.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 1163a2ee301..0997cd248fe 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -1108,10 +1108,13 @@ static efi_status_t efi_capsule_scan_dir(u16 ***files, unsigned int *num)
/* ignore an error */
EFI_CALL((*dirh->close)(dirh));
- /* in ascii order */
- /* FIXME: u16 version of strcasecmp */
+ /*
+ * Capsule files are applied in case insensitive alphabetic order
+ *
+ * TODO: special handling of rightmost period
+ */
qsort(tmp_files, count, sizeof(*tmp_files),
- (int (*)(const void *, const void *))strcasecmp);
+ (int (*)(const void *, const void *))u16_strcasecmp);
*files = tmp_files;
*num = count;
ret = EFI_SUCCESS;