Sophie

Sophie

distrib > * > 2010.0 > * > by-pkgid > b080aa38c5bb0041448f6fdafd4d9238 > files > 17

libedit-devel-3.0-0.20090722.1mdv2010.0.i586.rpm

--- export/src/readline.c	2009-07-22 23:27:40.000000000 +0200
+++ ../src/readline.c	2009-07-22 23:49:25.000000000 +0200
@@ -29,7 +29,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
+#include <config.h>
+
 #if !defined(lint) && !defined(SCCSID)
 __RCSID("$NetBSD: readline.c,v 1.84 2009/07/22 15:57:40 christos Exp $");
 #endif /* not lint && not SCCSID */
@@ -47,17 +48,17 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <setjmp.h>
-#ifdef HAVE_VIS_H
 #include <vis.h>
-#else
-#include "np/vis.h"
-#endif
-#include "readline/readline.h"
+#include "editline/readline.h"
 #include "el.h"
 #include "fcns.h"		/* for EL_NUM_FCNS */
 #include "histedit.h"
 #include "filecomplete.h"
 
+#if !defined(SIZE_T_MAX)
+# define SIZE_T_MAX (size_t)(-1) 
+#endif
+
 void rl_prep_terminal(int);
 void rl_deprep_terminal(void);
 
@@ -192,7 +193,7 @@
 		return (HIST_ENTRY *) NULL;
 
 	rl_he.line = ev.str;
-	rl_he.data = NULL;
+	rl_he.data = (histdata_t) &(ev.num);
 
 	return (&rl_he);
 }
@@ -1452,8 +1453,7 @@
 char *
 username_completion_function(const char *text, int state)
 {
-	struct passwd *pwd, pwres;
-	char pwbuf[1024];
+	struct passwd *pwd;
 
 	if (text[0] == '\0')
 		return (NULL);
@@ -1464,9 +1464,9 @@
 	if (state == 0)
 		setpwent();
 
-	while (getpwent_r(&pwres, pwbuf, sizeof(pwbuf), &pwd) == 0
-	    && pwd != NULL && text[0] == pwd->pw_name[0]
-	    && strcmp(text, pwd->pw_name) == 0);
+   while ((pwd = getpwent())
+		&& pwd != NULL && text[0] == pwd->pw_name[0]
+		&& strcmp(text, pwd->pw_name) == 0);
 
 	if (pwd == NULL) {
 		endpwent();