diff options
author | unknown <jimw@mysql.com> | 2005-07-18 17:22:38 -0700 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-07-18 17:22:38 -0700 |
commit | bb2fb2af223453682932201e92b56f275fd8f039 (patch) | |
tree | 8f787c005becfbba10a82a9f9d1fad6130b0b38f /cmd-line-utils/readline/input.c | |
parent | c68257043108de5e58b7a769089036c6692b8df3 (diff) | |
download | mariadb-git-bb2fb2af223453682932201e92b56f275fd8f039.tar.gz |
Upgrade bundled readline to version 5.0.
cmd-line-utils/readline/INSTALL:
Import readline-5.0
cmd-line-utils/readline/Makefile.am:
Import readline-5.0
cmd-line-utils/readline/README:
Import readline-5.0
cmd-line-utils/readline/bind.c:
Import readline-5.0
cmd-line-utils/readline/callback.c:
Import readline-5.0
cmd-line-utils/readline/chardefs.h:
Import readline-5.0
cmd-line-utils/readline/complete.c:
Import readline-5.0
cmd-line-utils/readline/configure.in:
Import readline-5.0
cmd-line-utils/readline/display.c:
Import readline-5.0
cmd-line-utils/readline/funmap.c:
Import readline-5.0
cmd-line-utils/readline/histexpand.c:
Import readline-5.0
cmd-line-utils/readline/histfile.c:
Import readline-5.0
cmd-line-utils/readline/history.c:
Import readline-5.0
cmd-line-utils/readline/history.h:
Import readline-5.0
cmd-line-utils/readline/histsearch.c:
Import readline-5.0
cmd-line-utils/readline/input.c:
Import readline-5.0
cmd-line-utils/readline/isearch.c:
Import readline-5.0
cmd-line-utils/readline/keymaps.c:
Import readline-5.0
cmd-line-utils/readline/kill.c:
Import readline-5.0
cmd-line-utils/readline/macro.c:
Import readline-5.0
cmd-line-utils/readline/mbutil.c:
Import readline-5.0
cmd-line-utils/readline/misc.c:
Import readline-5.0
cmd-line-utils/readline/nls.c:
Import readline-5.0
cmd-line-utils/readline/parens.c:
Import readline-5.0
cmd-line-utils/readline/posixdir.h:
Import readline-5.0
cmd-line-utils/readline/readline.c:
Import readline-5.0
cmd-line-utils/readline/readline.h:
Import readline-5.0
cmd-line-utils/readline/rldefs.h:
Import readline-5.0
cmd-line-utils/readline/rlmbutil.h:
Import readline-5.0
cmd-line-utils/readline/rlprivate.h:
Import readline-5.0
cmd-line-utils/readline/rlstdc.h:
Import readline-5.0
cmd-line-utils/readline/rltty.c:
Import readline-5.0
cmd-line-utils/readline/rltty.h:
Import readline-5.0
cmd-line-utils/readline/rltypedefs.h:
Import readline-5.0
cmd-line-utils/readline/search.c:
Import readline-5.0
cmd-line-utils/readline/shell.c:
Import readline-5.0
cmd-line-utils/readline/signals.c:
Import readline-5.0
cmd-line-utils/readline/terminal.c:
Import readline-5.0
cmd-line-utils/readline/text.c:
Import readline-5.0
cmd-line-utils/readline/tilde.c:
Import readline-5.0
cmd-line-utils/readline/undo.c:
Import readline-5.0
cmd-line-utils/readline/util.c:
Import readline-5.0
cmd-line-utils/readline/vi_mode.c:
Import readline-5.0
cmd-line-utils/readline/xmalloc.c:
Import readline-5.0
Diffstat (limited to 'cmd-line-utils/readline/input.c')
-rw-r--r-- | cmd-line-utils/readline/input.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/cmd-line-utils/readline/input.c b/cmd-line-utils/readline/input.c index d9c52dfcec8..044338e879b 100644 --- a/cmd-line-utils/readline/input.c +++ b/cmd-line-utils/readline/input.c @@ -21,7 +21,13 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (__TANDEM) +# include <floss.h> +#endif + +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> #include <fcntl.h> @@ -152,6 +158,12 @@ _rl_unget_char (key) return (0); } +int +_rl_pushed_input_available () +{ + return (push_index != pop_index); +} + /* If a character is available to be read, then read it and stuff it into IBUFFER. Otherwise, just return. Returns number of characters read (0 if none available) and -1 on error (EIO). */ @@ -160,7 +172,7 @@ rl_gather_tyi () { int tty; register int tem, result; - int chars_avail; + int chars_avail, k; char input; #if defined(HAVE_SELECT) fd_set readfds, exceptfds; @@ -200,6 +212,11 @@ rl_gather_tyi () fcntl (tty, F_SETFL, tem); if (chars_avail == -1 && errno == EAGAIN) return 0; + if (chars_avail == 0) /* EOF */ + { + rl_stuff_char (EOF); + return (0); + } } #endif /* O_NDELAY */ @@ -223,7 +240,12 @@ rl_gather_tyi () if (result != -1) { while (chars_avail--) - rl_stuff_char ((*rl_getc_function) (rl_instream)); + { + k = (*rl_getc_function) (rl_instream); + rl_stuff_char (k); + if (k == NEWLINE || k == RETURN) + break; + } } else { @@ -385,7 +407,7 @@ rl_read_key () else { /* If input is coming from a macro, then use that. */ - if ((c = _rl_next_macro_key ())) + if (c = _rl_next_macro_key ()) return (c); /* If the user has an event function, then call it periodically. */ |