* ext/readline/readline.c (readline_s_set_completion_append_character):
accept nil. [ruby-core:03765] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2bf189db24
commit
964171ebfa
@ -1,3 +1,8 @@
|
|||||||
|
Fri Nov 19 10:32:36 2004 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/readline/readline.c (readline_s_set_completion_append_character):
|
||||||
|
accept nil. [ruby-core:03765]
|
||||||
|
|
||||||
Fri Nov 19 00:59:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Fri Nov 19 00:59:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* string.c (str_gsub): internal buffer should not be listed by
|
* string.c (str_gsub): internal buffer should not be listed by
|
||||||
|
@ -204,11 +204,16 @@ readline_s_set_completion_append_character(self, str)
|
|||||||
{
|
{
|
||||||
#ifdef READLINE_21_OR_LATER
|
#ifdef READLINE_21_OR_LATER
|
||||||
rb_secure(4);
|
rb_secure(4);
|
||||||
SafeStringValue(str);
|
if (NIL_P(str)) {
|
||||||
if (NIL_P(str) || RSTRING(str)->len == 0) {
|
|
||||||
rl_completion_append_character = '\0';
|
rl_completion_append_character = '\0';
|
||||||
} else {
|
}
|
||||||
rl_completion_append_character = RSTRING(str)->ptr[0];
|
else {
|
||||||
|
SafeStringValue(str);
|
||||||
|
if (RSTRING(str)->len == 0) {
|
||||||
|
rl_completion_append_character = '\0';
|
||||||
|
} else {
|
||||||
|
rl_completion_append_character = RSTRING(str)->ptr[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -38,6 +38,15 @@ class TestReadline < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_completion_append_character
|
||||||
|
Readline.completion_append_character = nil
|
||||||
|
assert_equal(nil, Readline.completion_append_character)
|
||||||
|
Readline.completion_append_character = "x"
|
||||||
|
assert_equal("x", Readline.completion_append_character)
|
||||||
|
Readline.completion_append_character = "xyz"
|
||||||
|
assert_equal("x", Readline.completion_append_character)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def replace_stdio(stdin, stdout)
|
def replace_stdio(stdin, stdout)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user