[wiki] [sites] [dmenu][patch][caseinsensitive] swapped -i for -s in man file to match code || Nathan Sketch

From: <git_AT_suckless.org>
Date: Sun, 13 Dec 2020 14:31:42 +0100

commit 4c9d73200412d6b27dd9b3156cfacf750e574833
Author: Nathan Sketch <sketchn98_AT_gmail.com>
Date: Sun Dec 13 08:31:00 2020 -0500

    [dmenu][patch][caseinsensitive] swapped -i for -s in man file to match code

diff --git a/tools.suckless.org/dmenu/patches/case-insensitive/dmenu-caseinsensitive-5.0.diff b/tools.suckless.org/dmenu/patches/case-insensitive/dmenu-caseinsensitive-5.0.diff
new file mode 100644
index 00000000..f476bc9b
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/case-insensitive/dmenu-caseinsensitive-5.0.diff
_AT_@ -0,0 +1,53 @@
+diff --git a/dmenu.1 b/dmenu.1
+index 323f93c..3e3b31b 100644
+--- a/dmenu.1
++++ b/dmenu.1
+_AT_@ -3,7 +3,7 @@
+ dmenu \- dynamic menu
+ .SH SYNOPSIS
+ .B dmenu
+-.RB [ \-bfiv ]
++.RB [ \-bfsv ]
+ .RB [ \-l
+ .IR lines ]
+ .RB [ \-m
+_AT_@ -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
+_AT_@ -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)
+_AT_@ -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/tools.suckless.org/dmenu/patches/case-insensitive/index.md b/tools.suckless.org/dmenu/patches/case-insensitive/index.md
index cf560bcc..1af04969 100644
--- a/tools.suckless.org/dmenu/patches/case-insensitive/index.md
+++ b/tools.suckless.org/dmenu/patches/case-insensitive/index.md
_AT_@ -7,6 +7,7 @@ Adds an -s option to enable case-sensitive matching.
 
 Download
 --------
+* [dmenu-caseinsensitive-5.0.diff](dmenu-caseinsensitive-5.0.diff)
 * [dmenu-caseinsensitive-20200523-db6093f.diff](dmenu-caseinsensitive-20200523-db6093f.diff)
 
 Author
Received on Sun Dec 13 2020 - 14:31:42 CET

This archive was generated by hypermail 2.3.0 : Sun Dec 13 2020 - 14:36:45 CET