Bug #8782
closedDon't set rl_getc_function on editline
Description
r42402 ไปฅๆฅ OS X ็ญใฎ editline ็ฐๅขใงใฏ #define rl_getc(f) EOF ใไฝฟใใใใใใซใชใฃใฆใใพใฃใฆๆฎๅฟตใชใใจใซใชใฃใฆใใใใใงใใใ
ใใใใ editline ใฎ readline wrapper ใฏ non ASCII ใซๅฏพๅฟใใฆใใพใใใ
(editline ่ชไฝใซใฏ UTF-8 ใฎใฟใฎๅฏพๅฟใๅ
ฅใฃใใใreadline wrapper ใฏ src/readline.c ใฎ _getc_function ใ็ต็ฑใใใฎใง non ASCII ใฏๅใใ)
ใฎใงใใใฃใ rl_getc_function ใไฝฟใใชใใใใซใใฆใฏใฉใใงใใใใ
ไปฅไธใฎใใใชใใใใๅฝใฆใใจใreadline ใชใใฎ OS X ใฎ irb ใงๆฅๆฌ่ชใไฝฟใใใใใซใชใใพใใ
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index 0b121c1..bc0ee77 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -94,4 +94,5 @@ readline.have_func("clear_history")
readline.have_func("rl_redisplay")
readline.have_func("rl_insert_text")
readline.have_func("rl_delete_text")
+readline.have_func("el_init")
create_makefile("readline")
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 0f76d1a..85109f0 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -130,12 +130,7 @@ static VALUE readline_instream;
static VALUE readline_outstream;
#if defined HAVE_RL_GETC_FUNCTIONยถ
-#ifndef HAVE_RL_GETC
-#define rl_getc(f) EOF
-#endifยถ
-static int readline_getc(FILE *);
+# ifndef HAVE_EL_INIT
static int
readline_getc(FILE *input)
{
@@ -187,6 +182,7 @@ readline_getc(FILE *input)
#endif
return FIX2INT(c);
}
+# endif
#elif defined HAVE_RL_EVENT_HOOK
#define BUSY_WAIT 0
@@ -1771,7 +1767,9 @@ Init_readline()
/* libedit check rl_getc_function only when rl_initialize() is called, /
/ and using_history() call rl_initialize(). /
/ This assignment should be placed before using_history() */
+# ifndef HAVE_EL_INIT
rl_getc_function = readline_getc;
+# endif
#elif defined HAVE_RL_EVENT_HOOK
rl_event_hook = readline_event;
#endif
Updated by akr (Akira Tanaka) almost 12 years ago
rl_getc_function ใ่จญๅฎใใชใใจใreadline() ๅ ใงใใญใใฏใใๆใซไปใฎในใฌใใใใในใฆๆญขใพใฃใฆใใพใใฎใงใฏใชใใใจๆใใพใใ
ใใใฏใ็พๅจใrl_getc_function ๅ ใง read ใทในใใ ใณใผใซใๅผใณๅบใใจใใใ ใใ blocking region ใซใใฆใไปใฎในใฌใใใๅใใใใใซใใฆใใใใใงใใ
readline() ้ขๆฐๅ จไฝใ blocking region ๅ ใงๅฎ่กใใใจใใๆใฏใใใใใใใพใใใ
Updated by hsbt (Hiroshi SHIBATA) over 11 years ago
- Target version changed from 2.1.0 to 2.2.0
Updated by jeremyevans0 (Jeremy Evans) about 2 years ago
- Status changed from Assigned to Closed
- Backport deleted (
1.9.3: UNKNOWN, 2.0.0: UNKNOWN)
Readline support was removed in 59fd67fc3d405e529e038172e769ff20a8fb5535. If this is still an issue, please file it upstream https://github.com/ruby/readline-ext