From e24fa3ce621505e49835015ac2b430f65789bd62 Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 30 Sep 2005 22:02:56 +0000 Subject: Update to 1.0.20050911. Changes since 1997 (or 1995?) are too many to mention here, see http://dickey.his.com/dialog/CHANGES for details. Closes PR pkg/30856. --- misc/dialog/Makefile | 27 ++---- misc/dialog/PLIST | 14 +-- misc/dialog/distinfo | 19 +--- misc/dialog/patches/patch-aa | 76 --------------- misc/dialog/patches/patch-ab | 224 ------------------------------------------- misc/dialog/patches/patch-ac | 70 -------------- misc/dialog/patches/patch-ad | 35 ------- misc/dialog/patches/patch-ae | 89 ----------------- misc/dialog/patches/patch-af | 199 -------------------------------------- misc/dialog/patches/patch-ag | 25 ----- misc/dialog/patches/patch-ah | 71 -------------- misc/dialog/patches/patch-ai | 57 ----------- misc/dialog/patches/patch-aj | 24 ----- misc/dialog/patches/patch-ak | 11 --- 14 files changed, 14 insertions(+), 927 deletions(-) delete mode 100644 misc/dialog/patches/patch-aa delete mode 100644 misc/dialog/patches/patch-ab delete mode 100644 misc/dialog/patches/patch-ac delete mode 100644 misc/dialog/patches/patch-ad delete mode 100644 misc/dialog/patches/patch-ae delete mode 100644 misc/dialog/patches/patch-af delete mode 100644 misc/dialog/patches/patch-ag delete mode 100644 misc/dialog/patches/patch-ah delete mode 100644 misc/dialog/patches/patch-ai delete mode 100644 misc/dialog/patches/patch-aj delete mode 100644 misc/dialog/patches/patch-ak (limited to 'misc') diff --git a/misc/dialog/Makefile b/misc/dialog/Makefile index 532c4d1a910..ed1067f636f 100644 --- a/misc/dialog/Makefile +++ b/misc/dialog/Makefile @@ -1,34 +1,23 @@ -# $NetBSD: Makefile,v 1.28 2005/05/22 20:08:14 jlam Exp $ +# $NetBSD: Makefile,v 1.29 2005/09/30 22:02:56 wiz Exp $ -DISTNAME= dialog-0.6z -PKGREVISION= 3 +DISTNAME= dialog-1.0-20050911 +PKGNAME= ${DISTNAME:C/-2/.2/} CATEGORIES= misc -MASTER_SITES= ${MASTER_SITE_SUNSITE:=utils/shell/} +MASTER_SITES= ftp://invisible-island.net/dialog/ +EXTRACT_SUFX= .tgz MAINTAINER= tech-pkg@NetBSD.org +HOMEPAGE= http://dickey.his.com/dialog/dialog.html COMMENT= Display dialog boxes from shell scripts -USE_TOOLS+= gmake +GNU_CONFIGURE= yes +MAKEFILE= makefile INCOMPAT_CURSES= NetBSD-1.5* NetBSD-1.6[-_.]* NetBSD-1.6[A-P]-* PKG_INSTALLATION_TYPES= overwrite pkgviews -EGDIR= ${PREFIX}/share/examples/dialog -EGFILES= checklist guage infobox inputbox menubox msgbox -EGFILES+= radiolist textbox yesno - INSTALLATION_DIRS= bin man/man1 -post-install: - ${INSTALL_DATA_DIR} ${EGDIR} - cd ${WRKSRC}/samples; for file in ${EGFILES}; do \ - ${MV} $${file} $${file}.tmp; \ - ${SED} "s|\.\./dialog|${PREFIX}/bin/dialog|g" \ - $${file}.tmp > $${file}; \ - ${RM} $${file}.tmp; \ - ${INSTALL_SCRIPT} $${file} ${EGDIR}; \ - done - .include "../../devel/ncurses/buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/misc/dialog/PLIST b/misc/dialog/PLIST index 3f6bebce119..28668834698 100644 --- a/misc/dialog/PLIST +++ b/misc/dialog/PLIST @@ -1,13 +1,3 @@ -@comment $NetBSD: PLIST,v 1.1 2001/11/01 01:27:54 zuntum Exp $ +@comment $NetBSD: PLIST,v 1.2 2005/09/30 22:02:56 wiz Exp $ bin/dialog -man/man1/dialog.1.gz -share/examples/dialog/checklist -share/examples/dialog/guage -share/examples/dialog/infobox -share/examples/dialog/inputbox -share/examples/dialog/menubox -share/examples/dialog/msgbox -share/examples/dialog/radiolist -share/examples/dialog/textbox -share/examples/dialog/yesno -@dirrm share/examples/dialog +man/man1/dialog.1 diff --git a/misc/dialog/distinfo b/misc/dialog/distinfo index 5b51c11672a..05e4ea22e60 100644 --- a/misc/dialog/distinfo +++ b/misc/dialog/distinfo @@ -1,16 +1,5 @@ -$NetBSD: distinfo,v 1.6 2005/02/24 11:02:51 agc Exp $ +$NetBSD: distinfo,v 1.7 2005/09/30 22:02:56 wiz Exp $ -SHA1 (dialog-0.6z.tar.gz) = 3c9483554bbb63bb8838e1f7b31f2600a33198ad -RMD160 (dialog-0.6z.tar.gz) = 174a66402790388b3acdad1b49e624fefcf2dfb0 -Size (dialog-0.6z.tar.gz) = 50901 bytes -SHA1 (patch-aa) = 39dddd7e772d2d0e796ba80eb9309db8b5c679f5 -SHA1 (patch-ab) = 39318c50019277ffa1cecdb33f16e16c11ad37af -SHA1 (patch-ac) = 5862dd0163f2979b8071d8dbc6388c466a162042 -SHA1 (patch-ad) = 90a88a838923423cfe3bdbfc5d9de6d40bd10cee -SHA1 (patch-ae) = c0aae5c99837a17919fea47734d90fb6006dd381 -SHA1 (patch-af) = 4b47fa64e73deca0bb69ad1bc83102e46eaa01fe -SHA1 (patch-ag) = 55d7a46411d1e8775048b5d52e2451acba58e5bd -SHA1 (patch-ah) = 33a9423930fde5b785c70c4755adf946f8ceecdd -SHA1 (patch-ai) = fc2d0690cd07b019c031115eb92cad5f19b4904d -SHA1 (patch-aj) = ffa5f39a31dbaca2e4c10ec3d2034721a531cffa -SHA1 (patch-ak) = f720d9dd5f79fea389dfca662f7d2bc8dcbf95b6 +SHA1 (dialog-1.0-20050911.tgz) = 96c11fb4a98d5f9f074d8339fe2bad501e0f5786 +RMD160 (dialog-1.0-20050911.tgz) = 9fe5698fd2dda5cd2391302d39b081abf6f86ab8 +Size (dialog-1.0-20050911.tgz) = 307686 bytes diff --git a/misc/dialog/patches/patch-aa b/misc/dialog/patches/patch-aa deleted file mode 100644 index 499c091eafc..00000000000 --- a/misc/dialog/patches/patch-aa +++ /dev/null @@ -1,76 +0,0 @@ -$NetBSD: patch-aa,v 1.9 2003/10/08 03:01:32 danw Exp $ - ---- Makefile.orig Thu Jan 9 01:19:34 1997 -+++ Makefile Tue Oct 7 22:51:21 2003 -@@ -17,21 +17,19 @@ - # can be disabled to make dialog a bit smaller (could be done for more things) - HAVE_GUAGE=true - --BINDIR = /usr/bin --MANDIR = /usr/man/man1/ -+BINDIR = ${PREFIX}/bin -+MANDIR = ${PREFIX}/man/man1 - --CC = gcc --CPP = gcc -E --OPTIM = -O2 -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe -+#CC = gcc -+CPP = $(CC) -E -+#OPTIM = -O2 -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe - #OPTIM = -O -Wall -Wstrict-prototypes -g -pipe - - # end of the configuration part - #---------------------------------------------------------------------------- - # do not edit below this line - --CFLAGS = $(OPTIM) -DLOCALE -DVERSION=\"0.6z\" --LDFLAGS = -L . --LDLIBS = -ldialog -+CFLAGS += $(OPTIM) -DLOCALE -DVERSION=\"0.6z\" - - OBJS = checklist.o inputbox.o menubox.o msgbox.o \ - textbox.o util.o yesno.o -@@ -42,7 +40,7 @@ - OBJS+=mouse.o - endif - ifeq ($(HAVE_NCURSES), true) --CFLAGS+=-DHAVE_NCURSES -I/usr/include/ncurses -+CFLAGS+=-DHAVE_NCURSES - LDLIBS+=-lncurses - endif - ifeq ($(HAVE_RC_FILE), true) -@@ -56,12 +54,9 @@ - - SRCS = $(OBJS:.o=.c) - --all: libdialog.a dialog -+all: dialog - --libdialog.a: $(OBJS) -- ar rcs libdialog.a $(OBJS) -- --dialog: dialog.o -+dialog: dialog.o $(OBJS) - - clean: - rm -f core *.o *~ dialog .depend libdialog.a dialog.1 dialog.in -@@ -69,8 +64,8 @@ - - include .depend - --install: dialog libdialog.a -- install -s dialog $(BINDIR) -+install: dialog -+ ${BSD_INSTALL_PROGRAM} dialog $(BINDIR) - cp dialog.man dialog.1 - ifeq ($(HAVE_RC_FILE),false) - mv dialog.1 dialog.in -@@ -82,7 +77,7 @@ - endif - mv dialog.1 dialog.in - sed -e "/COMMENTSTART/,/COMMENTEND/d" dialog.in >dialog.1 -- install -m 644 dialog.1 $(MANDIR) -+ ${BSD_INSTALL_MAN} dialog.1 $(MANDIR) - # install -m 644 libdialog.a /usr/lib/ - - depend: diff --git a/misc/dialog/patches/patch-ab b/misc/dialog/patches/patch-ab deleted file mode 100644 index 687a222b808..00000000000 --- a/misc/dialog/patches/patch-ab +++ /dev/null @@ -1,224 +0,0 @@ -$NetBSD: patch-ab,v 1.3 2000/07/28 20:30:11 jlam Exp $ - ---- checklist.c.orig Thu Aug 17 19:36:06 1995 -+++ checklist.c Fri Jul 28 15:30:22 2000 -@@ -64,8 +64,8 @@ - int list_height, int item_no, const char * const * items, int flag, - int separate_output) - { -- int i, x, y, cur_x, cur_y, box_x, box_y; -- int key = 0, button = 0, choice = 0, scroll = 0, max_choice, *status; -+ int i, j, x, y, cur_x, cur_y, box_x, box_y; -+ int key = 0, button = 0, choice = 0, d_scroll = 0, max_choice, *status; - WINDOW *dialog, *list; - - checkflag = flag; -@@ -83,6 +83,26 @@ - - max_choice = MIN (list_height, item_no); - -+ /* Find length of longest item in order to center checklist */ -+ check_x = 0; -+ item_x = 0; -+ for (i = 0; i < item_no; i++) { -+ check_x = MAX (check_x, strlen (items[i * 3]) -+ + strlen (items[i * 3 + 1]) + 6); -+ item_x = MAX (item_x, strlen (items[i * 3])); -+ } -+ -+ /* Choose useful default height and width if they are negative */ -+ if (height < 0) -+ height = strheight(prompt) + list_height + 4 + 2; -+ if (width < 0) { -+ i = strwidth(prompt); -+ j = ((title != NULL) ? strwidth(title) : 0); -+ width = MAX (i, j); -+ width = MAX (width, check_x + 4) + 4; -+ } -+ width = MAX (width, MIN_DIALOG_WIDTH); -+ - /* center dialog box on screen */ - x = (COLS - width) / 2; - y = (LINES - height) / 2; -@@ -131,14 +151,6 @@ - draw_box (dialog, box_y, box_x, list_height + 2, list_width + 2, - menubox_border_attr, menubox_attr); - -- check_x = 0; -- item_x = 0; -- /* Find length of longest item in order to center checklist */ -- for (i = 0; i < item_no; i++) { -- check_x = MAX (check_x, strlen (items[i * 3]) -- + strlen (items[i * 3 + 1]) + 6); -- item_x = MAX (item_x, strlen (items[i * 3])); -- } - check_x = (list_width - check_x) / 2; - item_x = check_x + item_x + 6; - -@@ -171,7 +183,7 @@ - any item tag in list */ - for (i = 0; i < max_choice; i++) - if (toupper (key) == -- toupper (items[(scroll + i) * 3][0])) -+ toupper (items[(d_scroll + i) * 3][0])) - break; - - if (i < max_choice || -@@ -183,35 +195,35 @@ - i = key - '1'; - else if (key == KEY_UP || key == '-') { - if (!choice) { -- if (!scroll) -+ if (!d_scroll) - continue; - /* Scroll list down */ - getyx (dialog, cur_y, cur_x); - if (list_height > 1) { - /* De-highlight current first item */ -- print_item (list, items[scroll * 3], -- items[scroll * 3 + 1], status[scroll], -+ print_item (list, items[d_scroll * 3], -+ items[d_scroll * 3 + 1], status[d_scroll], - 0, FALSE); - scrollok (list, TRUE); - wscrl (list, -1); - scrollok (list, FALSE); - } -- scroll--; -- print_item (list, items[scroll * 3], -- items[scroll * 3 + 1], -- status[scroll], 0, TRUE); -+ d_scroll--; -+ print_item (list, items[d_scroll * 3], -+ items[d_scroll * 3 + 1], -+ status[d_scroll], 0, TRUE); - wnoutrefresh (list); - - /* print the up/down arrows */ - wmove (dialog, box_y, box_x + check_x + 5); -- wattrset (dialog, scroll ? uarrow_attr : menubox_attr); -- waddch (dialog, scroll ? ACS_UARROW : ACS_HLINE); -+ wattrset (dialog, d_scroll ? uarrow_attr : menubox_attr); -+ waddch (dialog, d_scroll ? ACS_UARROW : ACS_HLINE); - wmove (dialog, box_y, box_x + check_x + 6); -- waddch (dialog, scroll ? '(' : ACS_HLINE); -+ waddch (dialog, d_scroll ? '(' : ACS_HLINE); - wmove (dialog, box_y, box_x + check_x + 7); -- waddch (dialog, scroll ? '-' : ACS_HLINE); -+ waddch (dialog, d_scroll ? '-' : ACS_HLINE); - wmove (dialog, box_y, box_x + check_x + 8); -- waddch (dialog, scroll ? ')' : ACS_HLINE); -+ waddch (dialog, d_scroll ? ')' : ACS_HLINE); - wattrset (dialog, darrow_attr); - wmove (dialog, box_y + list_height + 1, - box_x + check_x + 5); -@@ -232,24 +244,24 @@ - i = choice - 1; - } else if (key == KEY_DOWN || key == '+') { - if (choice == max_choice - 1) { -- if (scroll + choice >= item_no - 1) -+ if (d_scroll + choice >= item_no - 1) - continue; - /* Scroll list up */ - getyx (dialog, cur_y, cur_x); - if (list_height > 1) { - /* De-highlight current last item before scrolling up */ -- print_item (list, items[(scroll + max_choice - 1) * 3], -- items[(scroll + max_choice - 1) * 3 + 1], -- status[scroll + max_choice - 1], -+ print_item (list, items[(d_scroll + max_choice - 1) * 3], -+ items[(d_scroll + max_choice - 1) * 3 + 1], -+ status[d_scroll + max_choice - 1], - max_choice - 1, FALSE); - scrollok (list, TRUE); - scroll (list); - scrollok (list, FALSE); - } -- scroll++; -- print_item (list, items[(scroll + max_choice - 1) * 3], -- items[(scroll + max_choice - 1) * 3 + 1], -- status[scroll + max_choice - 1], -+ d_scroll++; -+ print_item (list, items[(d_scroll + max_choice - 1) * 3], -+ items[(d_scroll + max_choice - 1) * 3 + 1], -+ status[d_scroll + max_choice - 1], - max_choice - 1, TRUE); - wnoutrefresh (list); - -@@ -261,21 +273,21 @@ - waddstr (dialog, "(-)"); - wmove (dialog, box_y + list_height + 1, - box_x + check_x + 5); -- wattrset (dialog, scroll + choice < item_no - 1 ? -+ wattrset (dialog, d_scroll + choice < item_no - 1 ? - darrow_attr : menubox_border_attr); -- waddch (dialog, scroll + choice < item_no - 1 ? -+ waddch (dialog, d_scroll + choice < item_no - 1 ? - ACS_DARROW : ACS_HLINE); - wmove (dialog, box_y + list_height + 1, - box_x + check_x + 6); -- waddch (dialog, scroll + choice < item_no - 1 ? -+ waddch (dialog, d_scroll + choice < item_no - 1 ? - '(' : ACS_HLINE); - wmove (dialog, box_y + list_height + 1, - box_x + check_x + 7); -- waddch (dialog, scroll + choice < item_no - 1 ? -+ waddch (dialog, d_scroll + choice < item_no - 1 ? - '+' : ACS_HLINE); - wmove (dialog, box_y + list_height + 1, - box_x + check_x + 8); -- waddch (dialog, scroll + choice < item_no - 1 ? -+ waddch (dialog, d_scroll + choice < item_no - 1 ? - ')' : ACS_HLINE); - wmove (dialog, cur_y, cur_x); - wrefresh (dialog); -@@ -284,21 +296,21 @@ - i = choice + 1; - } else if (key == ' ') { /* Toggle item status */ - if (flag == FLAG_CHECK) { -- status[scroll + choice] = !status[scroll + choice]; -+ status[d_scroll + choice] = !status[d_scroll + choice]; - getyx (dialog, cur_y, cur_x); - wmove (list, choice, check_x); - wattrset (list, check_selected_attr); -- wprintw (list, "[%c]", status[scroll + choice] ? 'X' : ' '); -+ wprintw (list, "[%c]", status[d_scroll + choice] ? 'X' : ' '); - } else { -- if (!status[scroll + choice]) { -+ if (!status[d_scroll + choice]) { - for (i = 0; i < item_no; i++) - status[i] = 0; -- status[scroll + choice] = 1; -+ status[d_scroll + choice] = 1; - getyx (dialog, cur_y, cur_x); - for (i = 0; i < max_choice; i++) -- print_item (list, items[(scroll + i) * 3], -- items[(scroll + i) * 3 + 1], -- status[scroll + i], i, i == choice); -+ print_item (list, items[(d_scroll + i) * 3], -+ items[(d_scroll + i) * 3 + 1], -+ status[d_scroll + i], i, i == choice); - } - } - wnoutrefresh (list); -@@ -309,14 +321,14 @@ - if (i != choice) { - /* De-highlight current item */ - getyx (dialog, cur_y, cur_x); -- print_item (list, items[(scroll + choice) * 3], -- items[(scroll + choice) * 3 + 1], -- status[scroll + choice], choice, FALSE); -+ print_item (list, items[(d_scroll + choice) * 3], -+ items[(d_scroll + choice) * 3 + 1], -+ status[d_scroll + choice], choice, FALSE); - /* Highlight new item */ - choice = i; -- print_item (list, items[(scroll + choice) * 3], -- items[(scroll + choice) * 3 + 1], -- status[scroll + choice], choice, TRUE); -+ print_item (list, items[(d_scroll + choice) * 3], -+ items[(d_scroll + choice) * 3 + 1], -+ status[d_scroll + choice], choice, TRUE); - wnoutrefresh (list); - wmove (dialog, cur_y, cur_x); - wrefresh (dialog); diff --git a/misc/dialog/patches/patch-ac b/misc/dialog/patches/patch-ac deleted file mode 100644 index b8b08e7fb1d..00000000000 --- a/misc/dialog/patches/patch-ac +++ /dev/null @@ -1,70 +0,0 @@ -$NetBSD: patch-ac,v 1.8 2003/09/15 15:02:55 jschauma Exp $ - ---- dialog.h.orig 1995-08-18 07:35:06.000000000 -0400 -+++ dialog.h 2003-09-14 21:47:41.000000000 -0400 -@@ -28,7 +28,7 @@ - #ifdef ultrix - #include - #else --#include -+#include - #endif - - /* -@@ -42,6 +42,7 @@ - #define TAB 9 - #define MAX_LEN 2048 - #define BUF_SIZE (10*1024) -+#define MIN_DIALOG_WIDTH 24 - #define MIN(x,y) (x < y ? x : y) - #define MAX(x,y) (x > y ? x : y) - -@@ -151,6 +152,9 @@ - void draw_shadow (WINDOW * win, int y, int x, int height, int width); - #endif - -+int strheight (const char *p); -+int strwidth (const char *p); -+ - int dialog_yesno (const char *title, const char *prompt, int height, int width); - int dialog_msgbox (const char *title, const char *prompt, int height, - int width, int pause); -@@ -171,33 +175,11 @@ - */ - #ifndef HAVE_LIBGPM - --extern __inline__ void --mouse_open (void) --{ --}; --extern __inline__ void --mouse_close (void) --{ --}; --extern __inline__ void --mouse_mkregion (int y, int x, int height, int width, -- int code) --{ --}; --extern __inline__ void --mouse_mkbigregion (int y, int x, int height, int width, -- int nitems, int th, int mode) --{ --}; --extern __inline__ void --mouse_setbase (int x, int y) --{ --}; --extern __inline__ int --mouse_wgetch (WINDOW * win) --{ --}; -- -+#define mouse_open() {} -+#define mouse_close() {} -+#define mouse_mkregion(y, x, height, width, code) {} -+#define mouse_mkbigregion(y, x, height, width, nitems, th, mode) {} -+#define mouse_setbase(x, y) {} - #define mouse_wgetch(w) wgetch(w) - - #else diff --git a/misc/dialog/patches/patch-ad b/misc/dialog/patches/patch-ad deleted file mode 100644 index aa8f001a257..00000000000 --- a/misc/dialog/patches/patch-ad +++ /dev/null @@ -1,35 +0,0 @@ -$NetBSD: patch-ad,v 1.3 2000/11/10 00:40:35 wiz Exp $ - ---- guage.c.orig Sat Aug 12 00:54:52 1995 -+++ guage.c -@@ -38,6 +38,11 @@ - char prompt_buf[1024]; - WINDOW *dialog; - -+ if (height < 0 || width < 0) { -+ fprintf(stderr, "\nAutosizing is impossible in dialog_textbox().\n"); -+ return(-1); -+ } -+ - /* center dialog box on screen */ - x = (COLS - width) / 2; - y = (LINES - height) / 2; -@@ -86,15 +91,15 @@ - - if (feof (stdin)) - break; -- gets (buf); -+ fgets (buf, sizeof(buf), stdin); - if (buf[0] == 'X') { - /* Next line is percentage */ -- gets (buf); -+ fgets (buf, sizeof(buf), stdin); - percent = atoi (buf); - - /* Rest is message text */ - prompt_buf[0] = '\0'; -- while (strncmp (gets (buf), "XXX", 3)) -+ while (strncmp (fgets (buf, sizeof(buf), stdin), "XXX", 3)) - strcat (prompt_buf, buf); - prompt = prompt_buf; - } else diff --git a/misc/dialog/patches/patch-ae b/misc/dialog/patches/patch-ae deleted file mode 100644 index 19a8f8ab9a8..00000000000 --- a/misc/dialog/patches/patch-ae +++ /dev/null @@ -1,89 +0,0 @@ -$NetBSD: patch-ae,v 1.3 2000/07/28 20:30:11 jlam Exp $ - ---- inputbox.c.orig Fri Aug 18 07:39:51 1995 -+++ inputbox.c Fri Jul 28 15:30:22 2000 -@@ -29,11 +29,21 @@ - dialog_inputbox (const char *title, const char *prompt, int height, int width, - const char *init) - { -- int i, x, y, box_y, box_x, box_width; -- int input_x = 0, scroll = 0, key = 0, button = -1; -+ int i, j, x, y, box_y, box_x, box_width; -+ int input_x = 0, d_scroll = 0, key = 0, button = -1; - unsigned char *instr = dialog_input_result; - WINDOW *dialog; - -+ /* Choose useful default height and width if they are negative */ -+ if (height < 0) -+ height = strheight(prompt) + 4 + 2; -+ if (width < 0) { -+ i = strwidth(prompt); -+ j = ((title != NULL) ? strwidth(title) : 0); -+ width = MAX (i, j) + 4; -+ } -+ width = MAX (width, MIN_DIALOG_WIDTH); -+ - /* center dialog box on screen */ - x = (COLS - width) / 2; - y = (LINES - height) / 2; -@@ -91,10 +101,10 @@ - strcpy (instr, init); - input_x = strlen (instr); - if (input_x >= box_width) { -- scroll = input_x - box_width + 1; -+ d_scroll = input_x - box_width + 1; - input_x = box_width - 1; - for (i = 0; i < box_width - 1; i++) -- waddch (dialog, instr[scroll + i]); -+ waddch (dialog, instr[d_scroll + i]); - } else - waddstr (dialog, instr); - wmove (dialog, box_y, box_x + input_x); -@@ -118,19 +128,19 @@ - continue; - case KEY_BACKSPACE: - case 127: -- if (input_x || scroll) { -+ if (input_x || d_scroll) { - wattrset (dialog, inputbox_attr); - 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 (dialog, box_y, box_x); - for (i = 0; i < box_width; i++) -- waddch (dialog, instr[scroll + input_x + i] ? -- instr[scroll + input_x + i] : ' '); -- input_x = strlen (instr) - scroll; -+ waddch (dialog, instr[d_scroll + input_x + i] ? -+ instr[d_scroll + input_x + i] : ' '); -+ input_x = strlen (instr) - d_scroll; - } else - input_x--; -- instr[scroll + input_x] = '\0'; -+ instr[d_scroll + input_x] = '\0'; - wmove (dialog, box_y, input_x + box_x); - waddch (dialog, ' '); - wmove (dialog, box_y, input_x + box_x); -@@ -139,15 +149,15 @@ - continue; - default: - if (key < 0x100 && isprint (key)) { -- if (scroll + input_x < MAX_LEN) { -+ if (d_scroll + input_x < MAX_LEN) { - wattrset (dialog, inputbox_attr); -- instr[scroll + input_x] = key; -- instr[scroll + input_x + 1] = '\0'; -+ instr[d_scroll + input_x] = key; -+ instr[d_scroll + input_x + 1] = '\0'; - if (input_x == box_width - 1) { -- scroll++; -+ d_scroll++; - wmove (dialog, box_y, box_x); - for (i = 0; i < box_width - 1; i++) -- waddch (dialog, instr[scroll + i]); -+ waddch (dialog, instr[d_scroll + i]); - } else { - wmove (dialog, box_y, input_x++ + box_x); - waddch (dialog, key); diff --git a/misc/dialog/patches/patch-af b/misc/dialog/patches/patch-af deleted file mode 100644 index d842935b116..00000000000 --- a/misc/dialog/patches/patch-af +++ /dev/null @@ -1,199 +0,0 @@ -$NetBSD: patch-af,v 1.3 2000/07/28 20:30:11 jlam Exp $ - ---- menubox.c.orig Thu Aug 17 22:21:00 1995 -+++ menubox.c Fri Jul 28 15:30:22 2000 -@@ -53,12 +53,32 @@ - dialog_menu (const char *title, const char *prompt, int height, int width, - int menu_height, int item_no, const char * const * items) - { -- int i, x, y, cur_x, cur_y, box_x, box_y; -- int key = 0, button = 0, choice = 0, scroll = 0, max_choice; -+ int i, j, x, y, cur_x, cur_y, box_x, box_y; -+ int key = 0, button = 0, choice = 0, d_scroll = 0, max_choice; - WINDOW *dialog, *menu; - - max_choice = MIN (menu_height, item_no); - -+ /* Find length of longest item in order to center menu */ -+ tag_x = 0; -+ item_x = 0; -+ for (i = 0; i < item_no; i++) { -+ tag_x = MAX (tag_x, -+ strlen (items[i * 2]) + strlen (items[i * 2 + 1]) + 2); -+ item_x = MAX (item_x, strlen (items[i * 2])); -+ } -+ -+ /* Choose useful default height and width if they are negative */ -+ if (height < 0) -+ height = strheight(prompt) + menu_height + 4 + 2; -+ if (width < 0) { -+ i = strwidth(prompt); -+ j = ((title != NULL) ? strwidth(title) : 0); -+ width = MAX (i, j); -+ width = MAX (width, tag_x + 4) + 4; -+ } -+ width = MAX (width, MIN_DIALOG_WIDTH); -+ - /* center dialog box on screen */ - x = (COLS - width) / 2; - y = (LINES - height) / 2; -@@ -107,14 +127,6 @@ - draw_box (dialog, box_y, box_x, menu_height + 2, menu_width + 2, - menubox_border_attr, menubox_attr); - -- tag_x = 0; -- item_x = 0; -- /* Find length of longest item in order to center menu */ -- for (i = 0; i < item_no; i++) { -- tag_x = MAX (tag_x, -- strlen (items[i * 2]) + strlen (items[i * 2 + 1]) + 2); -- item_x = MAX (item_x, strlen (items[i * 2])); -- } - tag_x = (menu_width - tag_x) / 2; - item_x = tag_x + item_x + 2; - -@@ -146,7 +158,7 @@ - /* Check if key pressed matches first character of any - item tag in menu */ - for (i = 0; i < max_choice; i++) -- if (toupper (key) == toupper (items[(scroll + i) * 2][0])) -+ if (toupper (key) == toupper (items[(d_scroll + i) * 2][0])) - break; - - if (i < max_choice || -@@ -159,33 +171,33 @@ - i = key - M_EVENT; - else if (key == KEY_UP || key == '-') { - if (!choice) { -- if (scroll) { -+ if (d_scroll) { - - /* Scroll menu down */ - getyx (dialog, cur_y, cur_x); - if (menu_height > 1) { - /* De-highlight current first item */ -- print_item (menu, items[scroll * 2], -- items[scroll * 2 + 1], 0, FALSE); -+ print_item (menu, items[d_scroll * 2], -+ items[d_scroll * 2 + 1], 0, FALSE); - scrollok (menu, TRUE); - wscrl (menu, -1); - scrollok (menu, FALSE); - } -- scroll--; -- print_item (menu, items[scroll * 2], -- items[scroll * 2 + 1], 0, TRUE); -+ d_scroll--; -+ print_item (menu, items[d_scroll * 2], -+ items[d_scroll * 2 + 1], 0, TRUE); - wnoutrefresh (menu); - - /* print the up/down arrows */ - wmove (dialog, box_y, box_x + tag_x + 1); -- wattrset (dialog, scroll ? uarrow_attr : menubox_attr); -- waddch (dialog, scroll ? ACS_UARROW : ACS_HLINE); -+ wattrset (dialog, d_scroll ? uarrow_attr : menubox_attr); -+ waddch (dialog, d_scroll ? ACS_UARROW : ACS_HLINE); - wmove (dialog, box_y, box_x + tag_x + 2); -- waddch (dialog, scroll ? '(' : ACS_HLINE); -+ waddch (dialog, d_scroll ? '(' : ACS_HLINE); - wmove (dialog, box_y, box_x + tag_x + 3); -- waddch (dialog, scroll ? '-' : ACS_HLINE); -+ waddch (dialog, d_scroll ? '-' : ACS_HLINE); - wmove (dialog, box_y, box_x + tag_x + 4); -- waddch (dialog, scroll ? ')' : ACS_HLINE); -+ waddch (dialog, d_scroll ? ')' : ACS_HLINE); - wattrset (dialog, darrow_attr); - wmove (dialog, box_y + menu_height + 1, - box_x + tag_x + 1); -@@ -201,21 +213,21 @@ - i = choice - 1; - } else if (key == KEY_DOWN || key == '+') - if (choice == max_choice - 1) { -- if (scroll + choice < item_no - 1) { -+ if (d_scroll + choice < item_no - 1) { - /* Scroll menu up */ - getyx (dialog, cur_y, cur_x); - if (menu_height > 1) { - /* De-highlight current last item */ -- print_item (menu, items[(scroll + max_choice - 1) -- * 2], items[(scroll + max_choice - 1) -+ print_item (menu, items[(d_scroll + max_choice - 1) -+ * 2], items[(d_scroll + max_choice - 1) - * 2 + 1], max_choice - 1, FALSE); - scrollok (menu, TRUE); - scroll (menu); - scrollok (menu, FALSE); - } -- scroll++; -- print_item (menu, items[(scroll + max_choice - 1) * 2], -- items[(scroll + max_choice - 1) * 2 + 1], -+ d_scroll++; -+ print_item (menu, items[(d_scroll + max_choice - 1) * 2], -+ items[(d_scroll + max_choice - 1) * 2 + 1], - max_choice - 1, TRUE); - wnoutrefresh (menu); - -@@ -227,21 +239,21 @@ - waddstr (dialog, "(-)"); - wmove (dialog, box_y + menu_height + 1, - box_x + tag_x + 1); -- wattrset (dialog, scroll + choice < item_no - 1 ? -+ wattrset (dialog, d_scroll + choice < item_no - 1 ? - darrow_attr : menubox_border_attr); -- waddch (dialog, scroll + choice < item_no - 1 ? -+ waddch (dialog, d_scroll + choice < item_no - 1 ? - ACS_DARROW : ACS_HLINE); - wmove (dialog, box_y + menu_height + 1, - box_x + tag_x + 2); -- waddch (dialog, scroll + choice < item_no - 1 ? -+ waddch (dialog, d_scroll + choice < item_no - 1 ? - '(' : ACS_HLINE); - wmove (dialog, box_y + menu_height + 1, - box_x + tag_x + 3); -- waddch (dialog, scroll + choice < item_no - 1 ? -+ waddch (dialog, d_scroll + choice < item_no - 1 ? - '+' : ACS_HLINE); - wmove (dialog, box_y + menu_height + 1, - box_x + tag_x + 4); -- waddch (dialog, scroll + choice < item_no - 1 ? -+ waddch (dialog, d_scroll + choice < item_no - 1 ? - ')' : ACS_HLINE); - wmove (dialog, cur_y, cur_x); - wrefresh (dialog); -@@ -253,13 +265,13 @@ - if (i != choice) { - /* De-highlight current item */ - getyx (dialog, cur_y, cur_x); /* Save cursor position */ -- print_item (menu, items[(scroll + choice) * 2], -- items[(scroll + choice) * 2 + 1], choice, FALSE); -+ print_item (menu, items[(d_scroll + choice) * 2], -+ items[(d_scroll + choice) * 2 + 1], choice, FALSE); - - /* Highlight new item */ - choice = i; -- print_item (menu, items[(scroll + choice) * 2], -- items[(scroll + choice) * 2 + 1], choice, TRUE); -+ print_item (menu, items[(d_scroll + choice) * 2], -+ items[(d_scroll + choice) * 2 + 1], choice, TRUE); - wnoutrefresh (menu); - wmove (dialog, cur_y, cur_x); - wrefresh (dialog); -@@ -271,7 +283,7 @@ - case 'o': - case M_EVENT + 'O': - delwin (dialog); -- return scroll + choice; -+ return d_scroll + choice; - case 'C': - case 'c': - case M_EVENT + 'C': -@@ -297,7 +309,7 @@ - break; - case '\n': - delwin (dialog); -- return (button? -2 : (scroll + choice)); -+ return (button? -2 : (d_scroll + choice)); - case ESC: - break; - } diff --git a/misc/dialog/patches/patch-ag b/misc/dialog/patches/patch-ag deleted file mode 100644 index a90855e085a..00000000000 --- a/misc/dialog/patches/patch-ag +++ /dev/null @@ -1,25 +0,0 @@ -$NetBSD: patch-ag,v 1.2 1998/08/07 11:10:15 agc Exp $ - ---- msgbox.c.orig Fri Jan 23 17:37:13 1998 -+++ msgbox.c Fri Jan 23 18:16:53 1998 -@@ -28,8 +28,19 @@ - dialog_msgbox (const char *title, const char *prompt, int height, int width, - int pause) - { -- int i, x, y, key = 0; -+ int i, j, x, y, key = 0; - WINDOW *dialog; -+ -+ /* Choose useful default height and width if they are negative */ -+ if (height < 0) -+ height = strheight(prompt) + 2 + 2 * (!!pause); -+ if (width < 0) { -+ i = strwidth(prompt); -+ j = ((title != NULL) ? strwidth(title) : 0); -+ width = MAX (i, j) + 4; -+ } -+ if (pause) -+ width = MAX (width, 10); - - /* center dialog box on screen */ - x = (COLS - width) / 2; diff --git a/misc/dialog/patches/patch-ah b/misc/dialog/patches/patch-ah deleted file mode 100644 index b0a7cbd0d06..00000000000 --- a/misc/dialog/patches/patch-ah +++ /dev/null @@ -1,71 +0,0 @@ -$NetBSD: patch-ah,v 1.3 2000/07/28 20:30:11 jlam Exp $ - ---- 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; - -+ if (height < 0 || width < 0) { -+ fprintf(stderr, "\nAutosizing is impossible in dialog_textbox().\n"); -+ return(-1); -+ } -+ - 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); diff --git a/misc/dialog/patches/patch-ai b/misc/dialog/patches/patch-ai deleted file mode 100644 index d2d96ab329f..00000000000 --- a/misc/dialog/patches/patch-ai +++ /dev/null @@ -1,57 +0,0 @@ -$NetBSD: patch-ai,v 1.2 1998/08/07 11:10:15 agc Exp $ - ---- util.c.orig Fri Jan 23 17:37:13 1998 -+++ util.c Fri Jan 23 17:37:12 1998 -@@ -361,3 +361,52 @@ - } - } - #endif -+ -+int strwidth(const char *p) -+{ -+ int i = 0, len, incr; -+ const char *start, *s, *s1, *s2; -+ -+ for (start = s = p; ; start = (s += incr)) { -+ s1 = strchr(s, '\n'); -+ s2 = strstr(s, "\\n"); -+ if (s2 == NULL) -+ s = s1; -+ else if (s1 == NULL) -+ s = s2; -+ else -+ s = MIN(s1, s2); -+ if (s == NULL) -+ break; -+ incr = 1 + (s == s2); -+ len = s - start; -+ if (len > i) -+ i = len; -+ } -+ len = strlen(start); -+ if (len > i) -+ i = len; -+ return i; -+} -+ -+int strheight(const char *p) -+{ -+ int i = 1, incr; -+ const char *s, *s1, *s2; -+ -+ for (s = p; ; s += incr) { -+ s1 = strchr(s, '\n'); -+ s2 = strstr(s, "\\n"); -+ if (s2 == NULL) -+ s = s1; -+ else if (s1 == NULL) -+ s = s2; -+ else -+ s = MIN(s1, s2); -+ if (s == NULL) -+ break; -+ incr = 1 + (s == s2); -+ i++; -+ } -+ return i; -+} diff --git a/misc/dialog/patches/patch-aj b/misc/dialog/patches/patch-aj deleted file mode 100644 index 154e7c3944f..00000000000 --- a/misc/dialog/patches/patch-aj +++ /dev/null @@ -1,24 +0,0 @@ -$NetBSD: patch-aj,v 1.2 1998/08/07 11:10:15 agc Exp $ - ---- yesno.c.orig Fri Jan 23 17:37:13 1998 -+++ yesno.c Fri Jan 23 18:17:16 1998 -@@ -26,8 +26,18 @@ - int - dialog_yesno (const char *title, const char *prompt, int height, int width) - { -- int i, x, y, key = 0, button = 0; -+ int i, j, x, y, key = 0, button = 0; - WINDOW *dialog; -+ -+ /* Choose useful default height and width if they are negative */ -+ if (height < 0) -+ height = strheight(prompt) + 4; -+ if (width < 0) { -+ i = strwidth(prompt); -+ j = ((title != NULL) ? strwidth(title) : 0); -+ width = MAX (i, j) + 4; -+ } -+ width = MAX (width, MIN_DIALOG_WIDTH); - - /* center dialog box on screen */ - x = (COLS - width) / 2; diff --git a/misc/dialog/patches/patch-ak b/misc/dialog/patches/patch-ak deleted file mode 100644 index 70f0e7c5a51..00000000000 --- a/misc/dialog/patches/patch-ak +++ /dev/null @@ -1,11 +0,0 @@ -$NetBSD: patch-ak,v 1.2 1998/08/07 11:10:16 agc Exp $ - ---- samples/infobox.orig Thu Jan 9 01:45:24 1997 -+++ samples/infobox Fri Jan 23 18:34:07 1998 -@@ -1,5 +1,5 @@ - #!/bin/sh --$DIALOG=${DIALOG=../dialog} -+DIALOG=${DIALOG=../dialog} - - $DIALOG --backtitle "dialog 0.6z - samples/infobox" --title "INFO BOX" \ - --infobox "Hi, this is an information box. It is -- cgit v1.2.3