Module Name: src
Committed By: christos
Date: Wed Apr 8 21:31:31 UTC 2009
Modified Files:
src/lib/libedit: readline.c
Log Message:
Fix off by one error reported by: Caleb Welton cwelton at greenplum dot com
To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/lib/libedit/readline.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.82 src/lib/libedit/readline.c:1.83
--- src/lib/libedit/readline.c:1.82 Tue Mar 31 13:53:03 2009
+++ src/lib/libedit/readline.c Wed Apr 8 17:31:31 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.c,v 1.82 2009/03/31 17:53:03 christos Exp $ */
+/* $NetBSD: readline.c,v 1.83 2009/04/08 21:31:31 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.82 2009/03/31 17:53:03 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.83 2009/04/08 21:31:31 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/types.h>
@@ -1864,6 +1864,7 @@
return NULL;
while ((match = (*fun)(str, (int)(len - 1))) != NULL) {
+ list[len++] = match;
if (len == max) {
char **nl;
max += 10;
@@ -1871,7 +1872,6 @@
goto out;
list = nl;
}
- list[len++] = match;
}
if (len == 1)
goto out;