dmenu

personal dmenu configuration
git clone git://git.eonn.xyz/dmenu.git
Log | Files | Refs | README | LICENSE

commit 224657e71994c5386704dc5f2a76feb0c8e0bde9
parent 5f64df0869171f6d76309564b9796d065004f37a
Author: Ian Ressa <ian@eonn.xyz>
Date:   Thu, 31 Mar 2022 13:12:13 -0400

Make search case-insensitive by default

Diffstat:
Mdmenu.c | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 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 unsigned int textw_clamp(const char *str, unsigned int n) @@ -762,9 +763,9 @@ main(int argc, char *argv[]) fast = 1; else if (!strcmp(argv[i], "-c")) /* centers dmenu on screen */ centered = 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 */