diff options
author | Ron Yorston <rmy@pobox.com> | 2018-12-08 15:45:44 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-12-08 16:05:12 +0000 |
commit | 195902a645b794092959ac3818f367104c7ffeb8 (patch) | |
tree | 56a6283283165fed9fffe84429918b75ecc772d6 /libbb/compare_string_array.c | |
parent | 88b782fb0e7ad26c8363eda5c850e5eba6acb445 (diff) | |
download | busybox-w32-195902a645b794092959ac3818f367104c7ffeb8.tar.gz busybox-w32-195902a645b794092959ac3818f367104c7ffeb8.tar.bz2 busybox-w32-195902a645b794092959ac3818f367104c7ffeb8.zip |
lineedit: improvements to tab completion
Since getpwent isn't implemented for WIN32 there's no point in
enabling FEATURE_USERNAME_COMPLETION.
Use case-insensitive comparisons when matching filenames.
The code to exclude non-executables when tab completing executables
is WIN32-specific and shouldn't omit directories.
Diffstat (limited to 'libbb/compare_string_array.c')
-rw-r--r-- | libbb/compare_string_array.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c index 01a9df0e2..7ccdaef8a 100644 --- a/libbb/compare_string_array.c +++ b/libbb/compare_string_array.c | |||
@@ -27,6 +27,19 @@ char* FAST_FUNC is_prefixed_with(const char *string, const char *key) | |||
27 | #endif | 27 | #endif |
28 | } | 28 | } |
29 | 29 | ||
30 | #if ENABLE_PLATFORM_MINGW32 | ||
31 | char* FAST_FUNC is_prefixed_with_case(const char *string, const char *key) | ||
32 | { | ||
33 | while (*key != '\0') { | ||
34 | if (tolower(*key) != tolower(*string)) | ||
35 | return NULL; | ||
36 | key++; | ||
37 | string++; | ||
38 | } | ||
39 | return (char*)string; | ||
40 | } | ||
41 | #endif | ||
42 | |||
30 | /* | 43 | /* |
31 | * Return NULL if string is not suffixed with key. Return pointer to the | 44 | * Return NULL if string is not suffixed with key. Return pointer to the |
32 | * beginning of prefix key in string. If key is an empty string return pointer | 45 | * beginning of prefix key in string. If key is an empty string return pointer |