Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Sep 2005 19:07:52 -0600 (MDT)
From:      Phil Oleson <oz@nixil.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/86355: Update apps that use libedit to use H_SETSIZE
Message-ID:  <200509200107.j8K17qbC098225@nixil.net>
Resent-Message-ID: <200509200110.j8K1A1BL038626@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         86355
>Category:       bin
>Synopsis:       Update apps that use libedit to use H_SETSIZE
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 20 01:10:01 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Phil Oleson
>Release:        HEAD
>Organization:
N/A
>Environment:
FreeBSD nixil.net 4.7-RELEASE-p28 FreeBSD 4.7-RELEASE-p28 #42: Tue Jun 21 10:33:20 MDT 2005 root@nixil.net:/usr/src/sys/compile/nixil  i386
>Description:
	Since Current has the latest libedit source, I'd prefer to see the 
        userspace apps using the proper define rather than the legacy define
        that should be removed (in the future).
>How-To-Repeat:
	N/A
>Fix:
Patches against HEAD

--- patch-sh begins here ---
Index: src/bin/sh/histedit.c
===================================================================
RCS file: /home/ncvs/src/bin/sh/histedit.c,v
retrieving revision 1.27
diff -u -r1.27 histedit.c
--- src/bin/sh/histedit.c	11 Aug 2005 20:28:26 -0000	1.27
+++ src/bin/sh/histedit.c	20 Sep 2005 00:47:14 -0000
@@ -156,7 +156,7 @@
 		if (hs == NULL || *hs == '\0' ||
 		   (histsize = atoi(hs)) < 0)
 			histsize = 100;
-		history(hist, &he, H_EVENT, histsize);
+		history(hist, &he, H_SETSIZE, histsize);
 	}
 }
 
@@ -318,7 +318,7 @@
 	if (editor) {
 		int fd;
 		INTOFF;		/* easier */
-		sprintf(editfile, "%s/_shXXXXXX", _PATH_TMP);
+		snprintf(editfile, sizeof(editfile), "%s_shXXXXXX", _PATH_TMP);
 		if ((fd = mkstemp(editfile)) < 0)
 			error("can't create temporary file %s", editfile);
 		if ((efp = fdopen(fd, "w")) == NULL) {
--- patch-sh ends here ---

--- patch-tftp begins here ---
Index: src/usr.bin/tftp/main.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/tftp/main.c,v
retrieving revision 1.21
diff -u -r1.21 main.c
--- src/usr.bin/tftp/main.c	12 Oct 2003 00:27:55 -0000	1.21
+++ src/usr.bin/tftp/main.c	20 Sep 2005 00:49:37 -0000
@@ -635,7 +635,7 @@
 	if (vrbose) {
 		el = el_init("tftp", stdin, stdout, stderr);
 		hist = history_init();
-		history(hist, &he, H_EVENT, 100);
+		history(hist, &he, H_SETSIZE, 100);
 		el_set(el, EL_HIST, history, hist);
 		el_set(el, EL_EDITOR, "emacs");
 		el_set(el, EL_PROMPT, command_prompt);
--- patch-tftp ends here ---

--- patch-lpr-lpc begins here ---
Index: src/usr.sbin/lpr/lpc/lpc.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/lpr/lpc/lpc.c,v
retrieving revision 1.30
diff -u -r1.30 lpc.c
--- src/usr.sbin/lpr/lpc/lpc.c	22 Feb 2005 02:56:42 -0000	1.30
+++ src/usr.sbin/lpr/lpc/lpc.c	20 Sep 2005 00:53:31 -0000
@@ -167,7 +167,7 @@
 			if (!el) {
 				el = el_init("lpc", stdin, stdout, stderr);
 				hist = history_init();
-				history(hist, &he, H_EVENT, 100);
+				history(hist, &he, H_SETSIZE, 100);
 				el_set(el, EL_HIST, history, hist);
 				el_set(el, EL_EDITOR, "emacs");
 				el_set(el, EL_PROMPT, lpc_prompt);
--- patch-lpr-lpc ends here ---

--- patch-fsdb begins here ---
Index: src/sbin/fsdb/fsdb.c
===================================================================
RCS file: /home/ncvs/src/sbin/fsdb/fsdb.c,v
retrieving revision 1.30
diff -u -r1.30 fsdb.c
--- src/sbin/fsdb/fsdb.c	7 Aug 2005 20:53:33 -0000	1.30
+++ src/sbin/fsdb/fsdb.c	20 Sep 2005 00:56:29 -0000
@@ -223,7 +223,7 @@
     printactive(0);
 
     hist = history_init();
-    history(hist, &he, H_EVENT, 100);	/* 100 elt history buffer */
+    history(hist, &he, H_SETSIZE, 100);	/* 100 elt history buffer */
 
     elptr = el_init("fsdb", stdin, stdout, stderr);
     el_set(elptr, EL_EDITOR, "emacs");
--- patch-fsdb ends here ---

--- patch-cdcontrol begins here ---
Index: src/usr.sbin/cdcontrol/cdcontrol.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/cdcontrol/cdcontrol.c,v
retrieving revision 1.48
diff -u -r1.48 cdcontrol.c
--- src/usr.sbin/cdcontrol/cdcontrol.c	1 Apr 2004 16:37:46 -0000	1.48
+++ src/usr.sbin/cdcontrol/cdcontrol.c	20 Sep 2005 00:57:33 -0000
@@ -1130,7 +1130,7 @@
 				el = el_init("cdcontrol", stdin, stdout,
 				    stderr);
 				hist = history_init();
-				history(hist, &he, H_EVENT, 100);
+				history(hist, &he, H_SETSIZE, 100);
 				el_set(el, EL_HIST, history, hist);
 				el_set(el, EL_EDITOR, "emacs");
 				el_set(el, EL_PROMPT, cdcontrol_prompt);
--- patch-cdcontrol ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509200107.j8K17qbC098225>