summaryrefslogtreecommitdiff
path: root/lib/libedit
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2009-04-08 21:31:31 +0000
committerchristos <christos@NetBSD.org>2009-04-08 21:31:31 +0000
commit46db7d011d7a801f695a317db00a17480c9aed54 (patch)
tree52491a1df0d626ba22247db47b4f02c20fbd8e9f /lib/libedit
parent48320d4cd34d6485103e10d8253299bd636c0ec7 (diff)
Fix off by one error reported by: Caleb Welton cwelton at greenplum dot com
Diffstat (limited to 'lib/libedit')
-rw-r--r--lib/libedit/readline.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libedit/readline.c b/lib/libedit/readline.c
index 20ab4040a10..d5957cf7122 100644
--- a/lib/libedit/readline.c
+++ b/lib/libedit/readline.c
@@ -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 @@ rl_completion_matches(const char *str, rl_compentry_func_t *fun)
return NULL;
while ((match = (*fun)(str, (int)(len - 1))) != NULL) {
+ list[len++] = match;
if (len == max) {
char **nl;
max += 10;
@@ -1871,7 +1872,6 @@ rl_completion_matches(const char *str, rl_compentry_func_t *fun)
goto out;
list = nl;
}
- list[len++] = match;
}
if (len == 1)
goto out;