[wiki] [sites] [dmenu][patch][tsv-alt] Fix patch for dmenu 5.3 for entries without tab || Max Schillinger

From: <git_AT_suckless.org>
Date: Sun, 14 Jul 2024 11:30:34 +0200

commit 886235a1ed3912b74b69f36ed1e7117847131b08
Author: Max Schillinger <maxschillinger_AT_web.de>
Date: Sun Jul 14 11:30:31 2024 +0200

    [dmenu][patch][tsv-alt] Fix patch for dmenu 5.3 for entries without tab

diff --git a/tools.suckless.org/dmenu/patches/tsv-alt/dmenu-tsv-alt-5.3.diff b/tools.suckless.org/dmenu/patches/tsv-alt/dmenu-tsv-alt-5.3.diff
index 378d6989..0cd3375a 100644
--- a/tools.suckless.org/dmenu/patches/tsv-alt/dmenu-tsv-alt-5.3.diff
+++ b/tools.suckless.org/dmenu/patches/tsv-alt/dmenu-tsv-alt-5.3.diff
_AT_@ -1,4 +1,4 @@
-From 89ff978d15ff6b58e21bf871f09ceab2bf813138 Mon Sep 17 00:00:00 2001
+From abc8bfeaaa5e62ce957d8a33ad1f5ca7c793513e Mon Sep 17 00:00:00 2001
 From: Max Schillinger <maxschillinger_AT_web.de>
 Date: Sat, 13 Jul 2024 21:06:57 +0200
 Subject: [PATCH] tsv-alt patch for dmenu 5.3
_AT_@ -6,8 +6,8 @@ Subject: [PATCH] tsv-alt patch for dmenu 5.3
 ---
  config.def.h | 5 +++++
  dmenu.1 | 6 +++++-
- dmenu.c | 26 ++++++++++++++++++--------
- 3 files changed, 28 insertions(+), 9 deletions(-)
+ dmenu.c | 21 ++++++++++++++-------
+ 3 files changed, 24 insertions(+), 8 deletions(-)
 
 diff --git a/config.def.h b/config.def.h
 index 1edb647..bd0fcef 100644
_AT_@ -47,7 +47,7 @@ index 323f93c..e767276 100644
  dmenu is completely controlled by the keyboard. Items are selected using the
  arrow keys, page up, page down, home, and end.
 diff --git a/dmenu.c b/dmenu.c
-index 40f93e0..04bb085 100644
+index 40f93e0..bee6b19 100644
 --- a/dmenu.c
 +++ b/dmenu.c
 _AT_@ -29,6 +29,7 @@ enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
_AT_@ -85,21 +85,17 @@ index 40f93e0..04bb085 100644
          size_t i, itemsiz = 0, linesiz = 0;
          ssize_t len;
  
-_AT_@ -561,14 +562,21 @@ readstdin(void)
+_AT_@ -561,14 +562,18 @@ readstdin(void)
                  }
                  if (line[len - 1] == '
')
                          line[len - 1] = ' - if (!(items[i].text = strdup(line)))
 + if (!(items[i].text = items[i].otext = strdup(line)))
                          die("strdup:");
--
-+		if ((items[i].otext = strchr(items[i].otext, '	'))) {
-+			*items[i].otext++ = '-+			if (revtab) {
-+				tmp = items[i].text;
-+				items[i].text = items[i].otext;
-+				items[i].otext = tmp;
-+			}
+ 
++		if ((tmp = strchr(items[i].text, '	'))) {
++			*tmp++ = '++			revtab ? (items[i].text = tmp) : (items[i].otext = tmp);
 +		}
  		items[i].out = 0;
  	}
_AT_@ -110,7 +106,7 @@ index 40f93e0..04bb085 100644
  	lines = MIN(lines, i);
  }
  
-_AT_@ -715,7 +723,7 @@ setup(void)
+_AT_@ -715,7 +720,7 @@ setup(void)
  static void
  usage(void)
  {
_AT_@ -119,7 +115,7 @@ index 40f93e0..04bb085 100644
  	    "             [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]");
  }
  
-_AT_@ -737,7 +745,9 @@ main(int argc, char *argv[])
+_AT_@ -737,7 +742,9 @@ main(int argc, char *argv[])
  		else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
  			fstrncmp = strncasecmp;
  			fstrstr = cistrstr;
Received on Sun Jul 14 2024 - 11:30:34 CEST

This archive was generated by hypermail 2.3.0 : Sun Jul 14 2024 - 11:36:48 CEST