aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2021-09-09 19:56:11 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2021-09-09 20:02:40 +0000
commit9e7bd94765c2ae7bc47d40abf56da5ae412f9f5f (patch)
tree6f7f5ccbeede6f6a8154637bdd276a8db26cb5f3
parent8eb9c3421ede92d3ffb5a993365a635d73cff285 (diff)
downloadports-9e7bd94765c2ae7bc47d40abf56da5ae412f9f5f.tar.gz
ports-9e7bd94765c2ae7bc47d40abf56da5ae412f9f5f.zip
ports-mgmt/dialog4ports: fix segfault
Fix segfault when moving selection in some dialog configurations Reported by: gad, kumba@gentoo.org Submitted by: rum1cro@yandex.ru (maintainer) PR: 244204
-rw-r--r--ports-mgmt/dialog4ports/Makefile2
-rw-r--r--ports-mgmt/dialog4ports/files/patch-mixedlist.c17
2 files changed, 18 insertions, 1 deletions
diff --git a/ports-mgmt/dialog4ports/Makefile b/ports-mgmt/dialog4ports/Makefile
index 1838aeb1f7fc..ae095d534143 100644
--- a/ports-mgmt/dialog4ports/Makefile
+++ b/ports-mgmt/dialog4ports/Makefile
@@ -2,7 +2,7 @@
PORTNAME= dialog4ports
PORTVERSION= 0.1.6
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES= ports-mgmt
MASTER_SITES= https://files.etoilebsd.net/dialog4ports/ \
http://mirror.shatow.net/freebsd/${PORTNAME}/ \
diff --git a/ports-mgmt/dialog4ports/files/patch-mixedlist.c b/ports-mgmt/dialog4ports/files/patch-mixedlist.c
new file mode 100644
index 000000000000..80e8a6c1191b
--- /dev/null
+++ b/ports-mgmt/dialog4ports/files/patch-mixedlist.c
@@ -0,0 +1,17 @@
+--- mixedlist.c_old 2021-01-03 16:01:52.851092000 +0300
++++ mixedlist.c 2021-01-03 16:06:04.266150000 +0300
+@@ -652,12 +652,12 @@
+ break;
+ case DLGK_ITEM_PREV:
+ i = choice - 1;
++ if (choice == 0 && scrollamt == 0)
++ continue;
+ if (items[scrollamt + i].type == ITEM_SEPARATOR && (scrollamt + i) == 0)
+ i++;
+ else if (items[scrollamt + i].type == ITEM_SEPARATOR)
+ i--;
+- if (choice == 0 && scrollamt == 0)
+- continue;
+ break;
+ case DLGK_ITEM_NEXT:
+ i = choice + 1;