Recently Written · git

sacc

Mirror of git://bitreich.org/sacc, the sacc gopher client from bitreich.org.

git clone https://github.com/equwal/sacc

Log | Files | Refs


commit b4f6ed2bf2344c5717523313bc666eb297a6fe36
Hiltjo Posthuma <hiltjo@codemadness.org>
2022-03-27 13:28:02 +0200

ui_ti: refactor DEC function key handling a bit for an upcoming commit

No functional change intended.

 ui_ti.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/ui_ti.c b/ui_ti.c
index 7f2ac21..b4072f7 100644
--- a/ui_ti.c
+++ b/ui_ti.c
@@ -424,7 +424,7 @@ uiselectitem(Item *entry)
 {
 	Dir *dir;
 	char *searchstr = NULL;
-	int plines = lines-2;
+	int c, plines = lines-2;
 
 	if (!entry || !(dir = entry->dat))
 		return NULL;
@@ -441,19 +441,21 @@ uiselectitem(Item *entry)
 			default:
 				continue;
 			}
-			switch (getchar()) {
+			c = getchar();
+			switch (c) {
 			case '4':
-				if (getchar() != '~')
-					continue;
-				goto end;
 			case '5':
-				if (getchar() != '~')
-					continue;
-				goto pgup;
 			case '6':
 				if (getchar() != '~')
 					continue;
-				goto pgdown;
+				switch (c) {
+				case '4':
+					goto end;
+				case '5':
+					goto pgup;
+				case '6':
+					goto pgdown;
+				}
 			case 'A':
 				goto lnup;
 			case 'B':