sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit e003d7d29abbe433772645e13c6de9d96023c6f1
parent fb333c31ecf8a9ae004a8005742e33291e5d7c23
Author: fengshaun <amoradi@fedoraproject.org>
Date:   Thu,  1 Dec 2016 02:54:20 -0600

Add case-insensitive match patch

Diffstat:
Atools.suckless.org/dmenu/patches/case-insensitive.md | 18++++++++++++++++++
Atools.suckless.org/dmenu/patches/dmenu-caseinsensitive-20161201-e90b88e.diff | 14++++++++++++++
2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/tools.suckless.org/dmenu/patches/case-insensitive.md b/tools.suckless.org/dmenu/patches/case-insensitive.md @@ -0,0 +1,18 @@ +case-insensitive +================ + +Description +----------- + +This patch adds support for case-insensitive searching to dmenu. This patch +works on top of fuzzymatch. + +Download +-------- + +* [dmenu-caseinsensitive-20161201-e90b88e.diff](dmenu-caseinsensitive-20161201-e90b88e.diff) + +Authors +------ + +* fengshaun diff --git a/tools.suckless.org/dmenu/patches/dmenu-caseinsensitive-20161201-e90b88e.diff b/tools.suckless.org/dmenu/patches/dmenu-caseinsensitive-20161201-e90b88e.diff @@ -0,0 +1,14 @@ +diff -up dmenu/dmenu.c dmenu-icase/dmenu.c +--- dmenu/dmenu.c 2016-12-01 02:51:31.642969377 -0600 ++++ dmenu-icase/dmenu.c 2016-12-01 02:51:53.889635972 -0600 +@@ -296,8 +296,8 @@ fuzzymatch(void) + sidx = eidx = -1; + /* walk through item text */ + for (i = 0; i < itext_len && (c = item->text[i]); i++) { +- /* fuzzy match pattern */ +- if (text[pidx] == c) { ++ /* case-insensitive fuzzy match pattern */ ++ if (tolower(text[pidx]) == c || toupper(text[pidx]) == c) { + if (sidx == -1) + sidx = i; + pidx++;