diff options
author | ache <ache@FreeBSD.org> | 2006-12-31 09:06:30 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2006-12-31 09:06:30 +0000 |
commit | 0e6bca45b1aeb189311204a2b5d10ca61fdf4ae3 (patch) | |
tree | 7ab23277706b512032dc5a9144d193728ba52eae /contrib/libreadline/readline.c | |
parent | ead5fc05b9835be798994dfae32172fde03e9d74 (diff) | |
download | FreeBSD-src-0e6bca45b1aeb189311204a2b5d10ca61fdf4ae3.zip FreeBSD-src-0e6bca45b1aeb189311204a2b5d10ca61fdf4ae3.tar.gz |
Virgin import of GNU Readline 5.2
Diffstat (limited to 'contrib/libreadline/readline.c')
-rw-r--r-- | contrib/libreadline/readline.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/libreadline/readline.c b/contrib/libreadline/readline.c index 5eaaf47..c2b7400 100644 --- a/contrib/libreadline/readline.c +++ b/contrib/libreadline/readline.c @@ -49,6 +49,11 @@ #include <stdio.h> #include "posixjmp.h" +#include <errno.h> + +#if !defined (errno) +extern int errno; +#endif /* !errno */ /* System-specific feature definitions and include files. */ #include "rldefs.h" @@ -479,6 +484,20 @@ readline_internal_charloop () c = rl_read_key (); RL_UNSETSTATE(RL_STATE_READCMD); + /* look at input.c:rl_getc() for the circumstances under which this will + be returned; punt immediately on read error without converting it to + a newline. */ + if (c == READERR) + { +#if defined (READLINE_CALLBACKS) + RL_SETSTATE(RL_STATE_DONE); + return (rl_done = 1); +#else + eof_found = 1; + break; +#endif + } + /* EOF typed to a non-blank line is a <NL>. */ if (c == EOF && rl_end) c = NEWLINE; |