diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c95c03f --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.o + +dmenu + +*.orig diff --git a/dmenu b/dmenu deleted file mode 100755 index 9f350d4..0000000 Binary files a/dmenu and /dev/null differ diff --git a/dmenu.1 b/dmenu.1 index 323f93c..a5fdf33 100644 --- a/dmenu.1 +++ b/dmenu.1 @@ -3,7 +3,7 @@ dmenu \- dynamic menu .SH SYNOPSIS .B dmenu -.RB [ \-bfiv ] +.RB [ \-bfsv ] .RB [ \-l .IR lines ] .RB [ \-m @@ -45,7 +45,7 @@ dmenu grabs the keyboard before reading stdin if not reading from a tty. This is faster, but will lock up X until stdin reaches end\-of\-file. .TP .B \-i -dmenu matches menu items case insensitively. +dmenu matches menu items case sensitively. .TP .BI \-l " lines" dmenu lists items vertically, with the given number of lines. diff --git a/dmenu.c b/dmenu.c index 13e9acc..9dc0da0 100644 --- a/dmenu.c +++ b/dmenu.c @@ -57,8 +57,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 unsigned int textw_clamp(const char *str, unsigned int n) @@ -822,9 +823,9 @@ main(int argc, char *argv[]) fast = 1; else if (!strcmp(argv[i], "-F")) /* grabs keyboard before reading stdin */ fuzzy = 0; - 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 */ diff --git a/dmenu.o b/dmenu.o deleted file mode 100644 index 4b57417..0000000 Binary files a/dmenu.o and /dev/null differ diff --git a/drw.o b/drw.o deleted file mode 100644 index 86603d2..0000000 Binary files a/drw.o and /dev/null differ diff --git a/patches/dmenu-caseinsensitive-5.0.diff b/patches/dmenu-caseinsensitive-5.0.diff new file mode 100644 index 0000000..f476bc9 --- /dev/null +++ b/patches/dmenu-caseinsensitive-5.0.diff @@ -0,0 +1,53 @@ +diff --git a/dmenu.1 b/dmenu.1 +index 323f93c..3e3b31b 100644 +--- a/dmenu.1 ++++ b/dmenu.1 +@@ -3,7 +3,7 @@ + dmenu \- dynamic menu + .SH SYNOPSIS + .B dmenu +-.RB [ \-bfiv ] ++.RB [ \-bfsv ] + .RB [ \-l + .IR lines ] + .RB [ \-m +@@ -44,8 +44,8 @@ dmenu appears at the bottom of the screen. + dmenu grabs the keyboard before reading stdin if not reading from a tty. This + is faster, but will lock up X until stdin reaches end\-of\-file. + .TP +-.B \-i +-dmenu matches menu items case insensitively. ++.B \-s ++dmenu matches menu items case sensitively. + .TP + .BI \-l " lines" + dmenu lists items vertically, with the given number of lines. +diff --git a/dmenu.c b/dmenu.c +index 65f25ce..855df59 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) +@@ -709,9 +710,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 */ diff --git a/stest b/stest deleted file mode 100755 index c99534e..0000000 Binary files a/stest and /dev/null differ diff --git a/stest.o b/stest.o deleted file mode 100644 index 2f98e41..0000000 Binary files a/stest.o and /dev/null differ diff --git a/util.o b/util.o deleted file mode 100644 index 6ab501f..0000000 Binary files a/util.o and /dev/null differ