From 47993929c4727ec1e7e7af4b2d2177d0058b84f8 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 20 Jun 2002 12:14:33 +0000 Subject: [PATCH] * 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/trunk@2588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/readline/readline.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7adbde50d7..dce027c5f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jun 20 21:09:37 2002 Nobuyoshi Nakada + + * 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 * lib/ftool.rb (BUFSIZE): tuning, set buffer length to 8192. diff --git a/ext/readline/readline.c b/ext/readline/readline.c index a6554a5b57..7162042163 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -1,6 +1,7 @@ /* readline.c -- GNU Readline module Copyright (C) 1997-2001 Shugo Maeda */ +#include #include #include #include @@ -44,6 +45,8 @@ readline_readline(argc, argv, self) prompt = StringValuePtr(tmp); } + if (!isatty(0) && errno == EBADF) rb_raise(rb_eIOError, "stdin closed"); + buff = (char*)rb_protect((VALUE(*)_((VALUE)))readline, (VALUE)prompt, &status); if (status) {