From 37852577fc1b0ce18b0178f6690bd42f28bc203a Mon Sep 17 00:00:00 2001 From: shugo Date: Fri, 20 May 2005 06:57:06 +0000 Subject: * ext/readline/readline.c (readline_attempted_completion_function): return 2 items if completion_proc returns only 1 item (for libedit). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/readline/readline.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 0b7673b75f..d5c2324d8e 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -4,6 +4,7 @@ #include #include #include +#include #ifdef HAVE_READLINE_READLINE_H #include #endif @@ -167,9 +168,9 @@ readline_attempted_completion_function(text, start, end) result[matches + 1] = NULL; if (matches == 1) { - result[0] = result[1]; - result[1] = NULL; - } else { + result[0] = strdup(result[1]); + } + else { register int i = 1; int low = 100000; -- cgit v1.2.3