diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-20 12:14:33 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-20 12:14:33 +0000 |
| commit | ef408c00bea0b80117c4aa28d9769fa2d54af20f (patch) | |
| tree | d653e05315fee8d1f4c3e4e2d817d5b684851196 /ext/readline | |
| parent | 10e5eb9beea5a63960a38505384046251230d18c (diff) | |
| download | ruby-ef408c00bea0b80117c4aa28d9769fa2d54af20f.tar.gz ruby-ef408c00bea0b80117c4aa28d9769fa2d54af20f.tar.xz ruby-ef408c00bea0b80117c4aa28d9769fa2d54af20f.zip | |
* ext/readline/readline.c (readline_readline): get rid of
libreadline's bug. (ruby-bugs-ja:PR#268)
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/readline')
| -rw-r--r-- | ext/readline/readline.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c index a6554a5b5..716204216 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 <errno.h> #include <stdio.h> #include <readline/readline.h> #include <readline/history.h> @@ -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) { |
