aboutsummaryrefslogtreecommitdiff
path: root/libbb/bb_qsort.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-04-19 12:51:19 +0100
committerRon Yorston <rmy@pobox.com>2023-04-19 12:51:19 +0100
commit7b81a44c87cf71dfb4f647ba107624e208ffbefe (patch)
tree3b1c803d823beb677827c0455834ec59d95f539b /libbb/bb_qsort.c
parent2eeb7a1e5c5242784a0c24a88042f98b9e69963a (diff)
downloadbusybox-w32-7b81a44c87cf71dfb4f647ba107624e208ffbefe.tar.gz
busybox-w32-7b81a44c87cf71dfb4f647ba107624e208ffbefe.tar.bz2
busybox-w32-7b81a44c87cf71dfb4f647ba107624e208ffbefe.zip
win32: case-sensitivity in tab completion
The tab-completion code treated all matches as case-insensitive because that's how Microsoft Windows handles filenames. This is now inadequate, as shell builtins, functions and aliases are case sensitive. Modify the treatment of case-sensitivity in tab completion: - Track whether each potential match is case-insensitive (filename) or case-sensitive (shell builtin, function or alias). - When comparing matches use a case-insensitive comparison if either value is a filename. Otherwise use a case-sensitive comparison. Adds 64 bytes.
Diffstat (limited to 'libbb/bb_qsort.c')
-rw-r--r--libbb/bb_qsort.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/libbb/bb_qsort.c b/libbb/bb_qsort.c
index 7afddf468..505045533 100644
--- a/libbb/bb_qsort.c
+++ b/libbb/bb_qsort.c
@@ -17,15 +17,3 @@ void FAST_FUNC qsort_string_vector(char **sv, unsigned count)
17{ 17{
18 qsort(sv, count, sizeof(char*), bb_pstrcmp); 18 qsort(sv, count, sizeof(char*), bb_pstrcmp);
19} 19}
20
21#if ENABLE_PLATFORM_MINGW32
22static int bb_pstrcasecmp(const void *a, const void *b)
23{
24 return strcasecmp(*(char**)a, *(char**)b);
25}
26
27void FAST_FUNC qsort_string_vector_case(char **sv, unsigned count)
28{
29 qsort(sv, count, sizeof(char*), bb_pstrcasecmp);
30}
31#endif