summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
authorkouji <kouji@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-12 16:13:11 +0000
committerkouji <kouji@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-12 16:13:11 +0000
commit8b123714e2f48d5aba6b48568b80352ead80d0ed (patch)
treed217ac137694e43a867e0d5fbc2af3b1bdf39970 /ext/readline
parent75fbac3b0db735de6ff72b171096855b5ded77d4 (diff)
* ext/readline/readline.c
(readline_s_get_completion_append_character): uses locale encoding but not ASCII-8BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/readline.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 6100633..87a1ff0 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -602,15 +602,14 @@ static VALUE
readline_s_get_completion_append_character(VALUE self)
{
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
- VALUE str;
+ char buf[1];
rb_secure(4);
if (rl_completion_append_character == '\0')
return Qnil;
- str = rb_str_new(0, 1);
- RSTRING_PTR(str)[0] = rl_completion_append_character;
- return str;
+ buf[0] = (char) rl_completion_append_character;
+ return rb_locale_str_new(buf, 1);
#else
rb_notimplement();
return Qnil; /* not reached */