[wiki] [sites] fix: fixed segfault on text output || bit9tream
commit f44010b2dc1ab3505fc0fb061f01f401c0e758ac
Author: bit9tream <bit6tream_AT_cock.li>
Date: Fri Jun 12 11:03:47 2020 +0300
fix: fixed segfault on text output
diff --git a/tools.suckless.org/dmenu/patches/multi-selection/dmenu-multi-selection-4.9.diff b/tools.suckless.org/dmenu/patches/multi-selection/dmenu-multi-selection-4.9.diff
index 537ccdc0..0cade666 100644
--- a/tools.suckless.org/dmenu/patches/multi-selection/dmenu-multi-selection-4.9.diff
+++ b/tools.suckless.org/dmenu/patches/multi-selection/dmenu-multi-selection-4.9.diff
_AT_@ -1,5 +1,5 @@
diff --git a/dmenu.c b/dmenu.c
-index 6b8f51b..c1e86b5 100644
+index 6b8f51b..af2fc99 100644
--- a/dmenu.c
+++ b/dmenu.c
_AT_@ -31,7 +31,8 @@ enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
_AT_@ -55,16 +55,15 @@ index 6b8f51b..c1e86b5 100644
drw_setscheme(drw, scheme[SchemeOut]);
else
drw_setscheme(drw, scheme[SchemeNorm]);
-_AT_@ -367,6 +381,21 @@ keypress(XKeyEvent *ev)
+_AT_@ -367,6 +381,20 @@ keypress(XKeyEvent *ev)
goto draw;
case XK_Return:
case XK_KP_Enter:
-+ if (issel(sel->id))
-+ for (int i = 0;i < selidsize;i++) {
++ if (issel(sel->id)) {
++ for (int i = 0;i < selidsize;i++)
+ if (selid[i] == sel->id)
+ selid[i] = -1;
-+ }
-+ else {
++ } else {
+ for (int i = 0;i < selidsize;i++)
+ if (selid[i] == -1) {
+ selid[i] = sel->id;
_AT_@ -77,7 +76,7 @@ index 6b8f51b..c1e86b5 100644
break;
case XK_bracketleft:
cleanup();
-_AT_@ -464,13 +493,19 @@ insert:
+_AT_@ -464,13 +492,17 @@ insert:
break;
case XK_Return:
case XK_KP_Enter:
_AT_@ -86,12 +85,10 @@ index 6b8f51b..c1e86b5 100644
+ for (int i = 0;i < selidsize;i++)
+ if (selid[i] != -1)
+ puts(items[selid[i]].text);
-+ if (!issel(sel->id)) {
-+ if (sel && !(ev->state & ShiftMask))
-+ puts(sel->text);
-+ else
-+ puts(text);
-+ }
++ if (sel && !(ev->state & ShiftMask))
++ puts(sel->text);
++ else
++ puts(text);
cleanup();
exit(0);
}
_AT_@ -100,7 +97,7 @@ index 6b8f51b..c1e86b5 100644
break;
case XK_Right:
if (text[cursor] != '-_AT_@ -534,7 +569,7 @@ readstdin(void)
+_AT_@ -534,7 +566,7 @@ readstdin(void)
*p = ' if (!(items[i].text = strdup(buf)))
die("cannot strdup %u bytes:", strlen(buf) + 1);
Received on Fri Jun 12 2020 - 10:04:34 CEST
This archive was generated by hypermail 2.3.0
: Fri Jun 12 2020 - 10:12:45 CEST