summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrafa_99 <rafa99@protonmail.com>2020-09-02 17:56:22 +0100
committerrafa_99 <rafa99@protonmail.com>2020-09-02 17:56:22 +0100
commit0f2d5ec20afe20537c0a9273c175494a3ea86959 (patch)
treeea93b266602303281e442293ed8cc8cff0ac1f30
parent8fb98fee53b13bc690c457dde0417b78b0532be4 (diff)
Case Insensitive Patch
-rw-r--r--dmenu.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/dmenu.c b/dmenu.c
index f0c3c6f..d934858 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -55,8 +55,9 @@ static Clr *scheme[SchemeLast];
#include "config.h"
-static int (*fstrncmp)(const char *, const char *, size_t) = strncmp;
-static char *(*fstrstr)(const char *, const char *) = strstr;
+static char * cistrstr(const char *s, const char *sub);
+static int (*fstrncmp)(const char *, const char *, size_t) = strncasecmp;
+static char *(*fstrstr)(const char *, const char *) = cistrstr;
static void
appenditem(struct item *item, struct item **list, struct item **last)
@@ -711,9 +712,9 @@ main(int argc, char *argv[])
topbar = 0;
else if (!strcmp(argv[i], "-f")) /* grabs keyboard before reading stdin */
fast = 1;
- else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
- fstrncmp = strncasecmp;
- fstrstr = cistrstr;
+ else if (!strcmp(argv[i], "-s")) { /* case-sensitive item matching */
+ fstrncmp = strncmp;
+ fstrstr = strstr;
} else if (i + 1 == argc)
usage();
/* these options take one argument */