summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-20 06:57:06 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-20 06:57:06 +0000
commit3c57fd294fd6a14c47ab1d906c100efbd0fa616f (patch)
treee5dad23498086acb2772a15ab8764e97d8601c7b
parent8bd72a214a1d2364d2af23439b7b5b571fc1be0a (diff)
downloadruby-3c57fd294fd6a14c47ab1d906c100efbd0fa616f.tar.gz
ruby-3c57fd294fd6a14c47ab1d906c100efbd0fa616f.tar.xz
ruby-3c57fd294fd6a14c47ab1d906c100efbd0fa616f.zip
* ext/readline/readline.c (readline_attempted_completion_function):
return 2 items if completion_proc returns only 1 item (for libedit). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/readline/readline.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 650f6a477..1692014b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri May 20 15:52:18 2005 Shugo Maeda <shugo@ruby-lang.org>
+
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ return 2 items if completion_proc returns only 1 item (for libedit).
+
Fri May 20 01:24:33 2005 Shugo Maeda <shugo@ruby-lang.org>
* ext/readline/extconf.rb: check rl_vi_editing_mode() and
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 0b7673b75..d5c2324d8 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -4,6 +4,7 @@
#include <errno.h>
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
#ifdef HAVE_READLINE_READLINE_H
#include <readline/readline.h>
#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;