[wiki] [sites] add patch dmenu-caseinsensitive || Kim Torgersen
commit e7cd9bc852ec2bca8dee3148d4fe4259038dff5f
Author: Kim Torgersen <kim_AT_torgersen.se>
Date: Sat May 23 15:23:29 2020 +0200
add patch dmenu-caseinsensitive
diff --git a/tools.suckless.org/dmenu/patches/case-insensitive/dmenu-caseinsensitive-20200523-db6093f.diff b/tools.suckless.org/dmenu/patches/case-insensitive/dmenu-caseinsensitive-20200523-db6093f.diff
new file mode 100644
index 00000000..939a2e80
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/case-insensitive/dmenu-caseinsensitive-20200523-db6093f.diff
_AT_@ -0,0 +1,42 @@
+From 54acbdf72083a5eae5783eed42e162424ab2cec2 Mon Sep 17 00:00:00 2001
+From: Kim Torgersen <kim_AT_torgersen.se>
+Date: Sat, 23 May 2020 14:48:28 +0200
+Subject: [PATCH] case-insensitive item matching default, case-sensitive option
+ (-s)
+
+---
+ dmenu.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+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 */
+--
+2.26.2
+
diff --git a/tools.suckless.org/dmenu/patches/case-insensitive/dmenu-caseinsensitive.png b/tools.suckless.org/dmenu/patches/case-insensitive/dmenu-caseinsensitive.png
new file mode 100644
index 00000000..c7cf9cd0
Binary files /dev/null and b/tools.suckless.org/dmenu/patches/case-insensitive/dmenu-caseinsensitive.png differ
diff --git a/tools.suckless.org/dmenu/patches/case-insensitive/index.md b/tools.suckless.org/dmenu/patches/case-insensitive/index.md
new file mode 100644
index 00000000..cf560bcc
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/case-insensitive/index.md
_AT_@ -0,0 +1,14 @@
+case-insensitive
+================
+This patch changes case-insensitive item matching to default behaviour.
+Adds an -s option to enable case-sensitive matching.
+
+[![Screenshot dmenu with caseinsensitive patch](dmenu-caseinsensitive.png)](dmenu-caseinsensitive.png)
+
+Download
+--------
+* [dmenu-caseinsensitive-20200523-db6093f.diff](dmenu-caseinsensitive-20200523-db6093f.diff)
+
+Author
+------
+* Kim Torgersen <kim_AT_torgersen.se>
Received on Sat May 23 2020 - 15:25:07 CEST
This archive was generated by hypermail 2.3.0
: Sat May 23 2020 - 15:36:48 CEST