1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/readline/readline.c (readline_readline): get rid of

libreadline's bug. (ruby-bugs-ja:PR#268)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2002-06-20 12:14:33 +00:00
parent 3865afc59b
commit a11a0860d1
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Thu Jun 20 21:09:37 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* ext/readline/readline.c (readline_readline): get rid of
libreadline's bug. (ruby-bugs-ja:PR#268)
Thu Jun 20 17:10:27 2002 WATANABE Hirofumi <eban@ruby-lang.org> Thu Jun 20 17:10:27 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* lib/ftool.rb (BUFSIZE): tuning, set buffer length to 8192. * lib/ftool.rb (BUFSIZE): tuning, set buffer length to 8192.

View file

@ -1,6 +1,7 @@
/* readline.c -- GNU Readline module /* readline.c -- GNU Readline module
Copyright (C) 1997-1998 Shugo Maeda */ Copyright (C) 1997-1998 Shugo Maeda */
#include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <readline/readline.h> #include <readline/readline.h>
#include <readline/history.h> #include <readline/history.h>
@ -42,6 +43,9 @@ readline_readline(argc, argv, self)
if (rb_scan_args(argc, argv, "02", &tmp, &add_hist) > 0) { if (rb_scan_args(argc, argv, "02", &tmp, &add_hist) > 0) {
prompt = STR2CSTR(tmp); prompt = STR2CSTR(tmp);
} }
if (!isatty(0) && errno == EBADF) rb_raise(rb_eIOError, "stdin closed");
buff = readline(prompt); buff = readline(prompt);
if (RTEST(add_hist) && buff) { if (RTEST(add_hist) && buff) {
add_history(buff); add_history(buff);