patch: case insensitive by default

This commit is contained in:
krolyxon 2023-11-10 01:16:14 +05:30
parent 9e27e75682
commit d50a045782
2 changed files with 5 additions and 4 deletions

BIN
dmenu

Binary file not shown.

View File

@ -66,8 +66,9 @@ static Clr *scheme[SchemeLast];
#include "config.h" #include "config.h"
static int (*fstrncmp)(const char *, const char *, size_t) = strncmp; static char * cistrstr(const char *s, const char *sub);
static char *(*fstrstr)(const char *, const char *) = strstr; static int (*fstrncmp)(const char *, const char *, size_t) = strncasecmp;
static char *(*fstrstr)(const char *, const char *) = cistrstr;
@ -1018,8 +1019,8 @@ main(int argc, char *argv[])
else if (!strcmp(argv[i], "-F")) /* grabs keyboard before reading stdin */ else if (!strcmp(argv[i], "-F")) /* grabs keyboard before reading stdin */
fuzzy = 0; fuzzy = 0;
else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */ else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
fstrncmp = strncasecmp; fstrncmp = strncmp;
fstrstr = cistrstr; fstrstr = strstr;
} else if (!strcmp(argv[i], "-P")) /* is the input a password */ } else if (!strcmp(argv[i], "-P")) /* is the input a password */
passwd = 1; passwd = 1;
else if (!strcmp(argv[i], "-r")) /* reject input which results in no match */ else if (!strcmp(argv[i], "-r")) /* reject input which results in no match */