add grub_qsort_strcmp to use when sorting array of strings

Compare function used in qsort gets arguments by reference, so strcmp
cannot be used directly - it expects pointer to char, but gets pointer
to pointer to char.

Introduce new helper grub_qsort_strcmp and use it in grub-install.
This helper is going to be used in a couple more places as well so
add it to global file, not in grub-install.c.
This commit is contained in:
Andrey Borzenkov 2013-12-07 14:29:00 +04:00
parent ad73cc3312
commit 3100cdc7f9
4 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2013-12-07 Andrey Borzenkov <arvidjaar@gmail.com>
* util/misc.c (grub_qsort_strcmp): Add qsort helper function to sort
strings.
* include/grub/util/misc.h: Define it ...
* util/grub-install.c (device_map_check_duplicates): ... and use it.
2013-12-07 Andrey Borzenkov <arvidjaar@gmail.com>
* util/grub.d/30_os-prober.in: Fix use of grub-probe instead of