Return to repo list

suckless-gf-dmenu

Gentoo-friendly patches for Suckless's dmenu.
Return to HMagellan.com

commit 20a8b84f2720d0b7e9f6df57a150c89dbb645339
parent 6f691846092bfa30adbb05e9d3022e2358f50a80
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Sat, 15 Aug 2020 16:13:16 -0500

Added caseinsensitive

Diffstat:
MREADME | 4++--
Apatches/caseinsensitive/USAGE | 21+++++++++++++++++++++
Apatches/caseinsensitive/caseinsensitive.patch | 42++++++++++++++++++++++++++++++++++++++++++
3 files changed, 65 insertions(+), 2 deletions(-)

diff --git a/README b/README @@ -42,8 +42,8 @@ patches! (1). https://dmenu.suckless.org/patches/ - CURRENT PROGRESS: 1/51 patches supported - 0/51 patches unsupported + CURRENT PROGRESS: 1/32 patches supported + 0/32 patches unsupported USUPPORTED PATCHES: None so far :-) diff --git a/patches/caseinsensitive/USAGE b/patches/caseinsensitive/USAGE @@ -0,0 +1,21 @@ +caseinsensitive - Case-insensitive matching in dmenu +Source: https://tools.suckless.org/dmenu/patches/case-insensitive/dmenu-caseinsensitive-20200523-db6093f.diff +Original Author: Kim Torgersen kim@torgersen.se + +Description from source: + """ + This patch changes case-insensitive item matching to default behaviour. Adds an -s option to enable + case-sensitive matching. + """ + +== YOU MUST == +(1). Place the patch file in /etc/portage/patches/x11-misc/dmenu/ and run 'emerge dmenu' + +== YOU PROBABLY SHOULD == +(1). If you need case-sensitive matching again while this patch is active, run dmenu with the '-s' option. + +== PATCH MODIFICATIONS == +No modifications were made to this patch. + +== INCOMPATIBILITIES == +No known specific incompatibilities. diff --git a/patches/caseinsensitive/caseinsensitive.patch b/patches/caseinsensitive/caseinsensitive.patch @@ -0,0 +1,42 @@ +From 54acbdf72083a5eae5783eed42e162424ab2cec2 Mon Sep 17 00:00:00 2001 +From: Kim Torgersen <kim@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 +@@ -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 */ +-- +2.26.2 +