summaryrefslogtreecommitdiff
path: root/misc/dialog/patches/patch-ah
diff options
context:
space:
mode:
Diffstat (limited to 'misc/dialog/patches/patch-ah')
-rw-r--r--misc/dialog/patches/patch-ah61
1 files changed, 58 insertions, 3 deletions
diff --git a/misc/dialog/patches/patch-ah b/misc/dialog/patches/patch-ah
index feeed9434e7..b0a7cbd0d06 100644
--- a/misc/dialog/patches/patch-ah
+++ b/misc/dialog/patches/patch-ah
@@ -1,7 +1,7 @@
-$NetBSD: patch-ah,v 1.2 1998/08/07 11:10:15 agc Exp $
+$NetBSD: patch-ah,v 1.3 2000/07/28 20:30:11 jlam Exp $
---- textbox.c.orig Fri Jan 23 17:37:13 1998
-+++ textbox.c Fri Jan 23 17:37:12 1998
+--- textbox.c.orig Thu Aug 17 19:07:40 1995
++++ textbox.c Fri Jul 28 15:30:22 2000
@@ -45,6 +45,11 @@
char search_term[MAX_LEN + 1], *tempptr, *found;
WINDOW *dialog, *text;
@@ -14,3 +14,58 @@ $NetBSD: patch-ah,v 1.2 1998/08/07 11:10:15 agc Exp $
search_term[0] = '\0'; /* no search term entered yet */
/* Open input file for reading */
+@@ -634,7 +639,7 @@
+ static int
+ get_search_term (WINDOW * win, char *search_term, int height, int width)
+ {
+- int i, x, y, input_x = 0, scroll = 0, key = 0;
++ int i, x, y, input_x = 0, d_scroll = 0, key = 0;
+ int box_height = 3, box_width = 30;
+
+ x = (width - box_width) / 2;
+@@ -663,18 +668,18 @@
+ break;
+ case KEY_BACKSPACE:
+ case 127:
+- if (input_x || scroll) {
++ if (input_x || d_scroll) {
+ if (!input_x) {
+- scroll = scroll < box_width - 1 ?
+- 0 : scroll - (box_width - 1);
++ d_scroll = d_scroll < box_width - 1 ?
++ 0 : d_scroll - (box_width - 1);
+ wmove (win, y + 1, x + 1);
+ for (i = 0; i < box_width; i++)
+- waddch (win, search_term[scroll + input_x + i] ?
+- search_term[scroll + input_x + i] : ' ');
+- input_x = strlen (search_term) - scroll;
++ waddch (win, search_term[d_scroll + input_x + i] ?
++ search_term[d_scroll + input_x + i] : ' ');
++ input_x = strlen (search_term) - d_scroll;
+ } else
+ input_x--;
+- search_term[scroll + input_x] = '\0';
++ search_term[d_scroll + input_x] = '\0';
+ wmove (win, y + 1, input_x + x + 1);
+ waddch (win, ' ');
+ wmove (win, y + 1, input_x + x + 1);
+@@ -685,14 +690,14 @@
+ break;
+ default:
+ if (isprint (key))
+- if (scroll + input_x < MAX_LEN) {
+- search_term[scroll + input_x] = key;
+- search_term[scroll + input_x + 1] = '\0';
++ if (d_scroll + input_x < MAX_LEN) {
++ search_term[d_scroll + input_x] = key;
++ search_term[d_scroll + input_x + 1] = '\0';
+ if (input_x == box_width - 1) {
+- scroll++;
++ d_scroll++;
+ wmove (win, y + 1, x + 1);
+ for (i = 0; i < box_width - 1; i++)
+- waddch (win, search_term[scroll + i]);
++ waddch (win, search_term[d_scroll + i]);
+ } else {
+ wmove (win, y + 1, input_x++ + x + 1);
+ waddch (win, key);