aboutsummaryrefslogtreecommitdiff
path: root/libbb/lineedit.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-12-08 20:25:14 +0000
committerRon Yorston <rmy@pobox.com>2018-12-08 20:25:14 +0000
commit44477db354f67c4eacfced89fac5fbf3dbeaa3ff (patch)
tree23d74f8c25decf11c9745a9cc0dac164aedbb731 /libbb/lineedit.c
parent195902a645b794092959ac3818f367104c7ffeb8 (diff)
downloadbusybox-w32-44477db354f67c4eacfced89fac5fbf3dbeaa3ff.tar.gz
busybox-w32-44477db354f67c4eacfced89fac5fbf3dbeaa3ff.tar.bz2
busybox-w32-44477db354f67c4eacfced89fac5fbf3dbeaa3ff.zip
lineedit: more case-insensitive comparisons in tab completion
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r--libbb/lineedit.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 979e0d544..89178bbc3 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -684,6 +684,9 @@ static void input_forward(void)
684# if ENABLE_PLATFORM_MINGW32 684# if ENABLE_PLATFORM_MINGW32
685/* use case-insensitive comparisons for filenames */ 685/* use case-insensitive comparisons for filenames */
686# define is_prefixed_with(s, k) is_prefixed_with_case(s, k) 686# define is_prefixed_with(s, k) is_prefixed_with_case(s, k)
687# define qsort_string_vector(s, c) qsort_string_vector_case(s, c)
688# define strcmp(s, t) strcasecmp(s, t)
689# define strncmp(s, t, n) strncasecmp(s, t, n)
687# endif 690# endif
688 691
689static void free_tab_completion_data(void) 692static void free_tab_completion_data(void)
@@ -1278,7 +1281,11 @@ static NOINLINE void input_tab(smallint *lastWasTab)
1278 for (cp = chosen_match; *cp; cp++) { 1281 for (cp = chosen_match; *cp; cp++) {
1279 unsigned n; 1282 unsigned n;
1280 for (n = 1; n < num_matches; n++) { 1283 for (n = 1; n < num_matches; n++) {
1284# if !ENABLE_PLATFORM_MINGW32
1281 if (matches[n][cp - chosen_match] != *cp) { 1285 if (matches[n][cp - chosen_match] != *cp) {
1286# else
1287 if (tolower(matches[n][cp - chosen_match]) != tolower(*cp)) {
1288# endif
1282 goto stop; 1289 goto stop;
1283 } 1290 }
1284 } 1291 }
@@ -1351,6 +1358,13 @@ static NOINLINE void input_tab(smallint *lastWasTab)
1351 free(match_buf); 1358 free(match_buf);
1352} 1359}
1353 1360
1361# if ENABLE_PLATFORM_MINGW32
1362# undef is_prefixed_with
1363# undef qsort_string_vector
1364# undef strcmp
1365# undef strncmp
1366# endif
1367
1354#endif /* FEATURE_TAB_COMPLETION */ 1368#endif /* FEATURE_TAB_COMPLETION */
1355 1369
1356 1370