Skip to content

Commit 5dbe515

Browse files
committed
make completion case-insensitive for cmds
File-name completions are still case-sensitive because the completion candidates are added via glob fn, which is itself case-sensitive by default. Therefore it doesn't matter how we compare them later.
1 parent 75f62d4 commit 5dbe515

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compl.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ static int do_compl(const char *prefix, int print, int *r_len,
8484

8585
for (i = 0; i < num; i++) {
8686
const char *c = get(i, arg);
87-
if (strncmp(prefix, c, len) == 0) {
87+
/* Note: even though strncasecmp() is used, file-name completions
88+
* are still case-sensitive because the completion candidates are
89+
* added via glob() fn, which is case-sensitive. */
90+
if (strncasecmp(prefix, c, len) == 0) {
8891
const char *p = c + len;
8992
int l = cmpstr(p, suff);
9093

0 commit comments

Comments
 (0)