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>
This commit is contained in:
parent
07355760b1
commit
93cdb95238
|
|
@ -1108,10 +1108,13 @@ static efi_status_t efi_capsule_scan_dir(u16 ***files, unsigned int *num)
|
||||||
/* ignore an error */
|
/* ignore an error */
|
||||||
EFI_CALL((*dirh->close)(dirh));
|
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),
|
qsort(tmp_files, count, sizeof(*tmp_files),
|
||||||
(int (*)(const void *, const void *))strcasecmp);
|
(int (*)(const void *, const void *))u16_strcasecmp);
|
||||||
*files = tmp_files;
|
*files = tmp_files;
|
||||||
*num = count;
|
*num = count;
|
||||||
ret = EFI_SUCCESS;
|
ret = EFI_SUCCESS;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue