summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/readline/readline.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 342d5a2adf..ff6a4bd887 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Feb 3 21:07:19 2009 TAKAO Kouji <kouji@takao7.net>
+
+ * ext/readline/readline.c (readline_s_set_completion_proc): set
+ default if proc is nil. fix #1095
+
Tue Feb 3 16:36:06 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* array.c (rb_ary_sort_by_bang): RDoc update.
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 7912989c21..feab70fb30 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -304,6 +304,8 @@ readline_s_set_output(VALUE self, VALUE output)
* should take input-string, and return an array of completion
* candidates.
*
+ * Set default if +proc+ is nil.
+ *
* Raises ArgumentError exception if +proc+ does not respond to call method.
*
* Raises SecurityError exception if $SAFE is 4.
@@ -312,7 +314,7 @@ static VALUE
readline_s_set_completion_proc(VALUE self, VALUE proc)
{
rb_secure(4);
- if (!rb_respond_to(proc, rb_intern("call")))
+ if (!NIL_P(proc) && !rb_respond_to(proc, rb_intern("call")))
rb_raise(rb_eArgError, "argument must respond to `call'");
return rb_ivar_set(mReadline, completion_proc, proc);
}