From: Chet Ramey Date: Mon, 21 Sep 2015 20:34:20 +0000 (-0400) Subject: commit readline-20150831 snapshot X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b7eb3aab1201ab80d633d2739ed0f0937ef2f6f0;p=thirdparty%2Freadline.git commit readline-20150831 snapshot --- diff --git a/CHANGELOG b/CHANGELOG index 9d03dca..6794591 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1299,3 +1299,8 @@ configure.ac,config.h.in ---- configure.ac - bump library version to 7.0 because of addition of rl_callback_sigcleanup + + 8/26 + ---- +configure.ac,Makefile.in,examples/Makefile.in + - remove references to purify diff --git a/Makefile.in b/Makefile.in index 272a329..6522573 100644 --- a/Makefile.in +++ b/Makefile.in @@ -45,8 +45,6 @@ RM = rm -f CP = cp MV = mv -PURIFY = @PURIFY@ - @SET_MAKE@ SHELL = @MAKE_SHELL@ diff --git a/configure b/configure index 1d80b94..655a451 100755 --- a/configure +++ b/configure @@ -631,7 +631,6 @@ LOCAL_DEFS LOCAL_LDFLAGS LOCAL_CFLAGS BUILD_DIR -PURIFY SHARED_INSTALL_TARGET STATIC_INSTALL_TARGET SHARED_TARGET @@ -722,7 +721,6 @@ ac_subst_files='' ac_user_opts=' enable_option_checking with_curses -with_purify enable_multibyte enable_shared enable_static @@ -1360,7 +1358,6 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-curses use the curses library instead of the termcap library - --with-purify configure to postprocess with purify Some influential environment variables: CC C compiler command @@ -2367,7 +2364,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac opt_curses=no -opt_purify=no # Check whether --with-curses was given. @@ -2376,22 +2372,10 @@ if test "${with_curses+set}" = set; then : fi -# Check whether --with-purify was given. -if test "${with_purify+set}" = set; then : - withval=$with_purify; opt_purify=$withval -fi - - if test "$opt_curses" = "yes"; then prefer_curses=yes fi -if test "$opt_purify" = yes; then - PURIFY="purify" -else - PURIFY= -fi - opt_multibyte=yes opt_static_libs=yes opt_shared_libs=yes @@ -6624,7 +6608,6 @@ esac - ac_config_files="$ac_config_files Makefile doc/Makefile examples/Makefile shlib/Makefile readline.pc" ac_config_commands="$ac_config_commands default" diff --git a/configure.ac b/configure.ac index 42e21fa..64f3386 100644 --- a/configure.ac +++ b/configure.ac @@ -39,22 +39,14 @@ AC_CANONICAL_BUILD dnl configure defaults opt_curses=no -opt_purify=no dnl arguments to configure AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval) -AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval) if test "$opt_curses" = "yes"; then prefer_curses=yes fi -if test "$opt_purify" = yes; then - PURIFY="purify" -else - PURIFY= -fi - dnl option parsing for optional features opt_multibyte=yes opt_static_libs=yes @@ -283,7 +275,6 @@ case "$BUILD_DIR" in *) ;; esac -AC_SUBST(PURIFY) AC_SUBST(BUILD_DIR) AC_SUBST(CFLAGS) diff --git a/doc/hsuser.texi b/doc/hsuser.texi index 3aa6cfa..dcd8dae 100644 --- a/doc/hsuser.texi +++ b/doc/hsuser.texi @@ -249,6 +249,11 @@ the input stream, making it easy to repeat commands, insert the arguments to a previous command into the current input line, or fix errors in previous commands quickly. +@ifset BashFeatures +History expansion is performed immediately after a complete line +is read, before the shell breaks it into words. +@end ifset + History expansion takes place in two parts. The first is to determine which line from the history list should be used during substitution. The second is to select portions of that line for inclusion into the @@ -262,7 +267,9 @@ History expansions are introduced by the appearance of the history expansion character, which is @samp{!} by default. @ifset BashFeatures Only @samp{\} and @samp{'} may be used to escape the history expansion -character. +character, but the history expansion character is +also treated as quoted if it immediately precedes the closing double quote +in a double-quoted string. @end ifset @ifset BashFeatures diff --git a/examples/Makefile.in b/examples/Makefile.in index 2d8f948..5723658 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -56,8 +56,6 @@ INCLUDES = -I$(srcdir) -I$(top_srcdir) -I.. CCFLAGS = $(DEFS) $(LOCAL_CFLAGS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) LDFLAGS = -g -L.. @LDFLAGS@ -PURIFY = @PURIFY@ - READLINE_LIB = ../libreadline.a HISTORY_LIB = ../libhistory.a @@ -104,40 +102,40 @@ uninstall: -rmdir $(DESTDIR)$(installdir) rl$(EXEEXT): rl.o $(READLINE_LIB) - $(PURIFY) $(CC) $(LDFLAGS) -o $@ rl.o $(READLINE_LIB) $(TERMCAP_LIB) + $(CC) $(LDFLAGS) -o $@ rl.o $(READLINE_LIB) $(TERMCAP_LIB) rlbasic$(EXEEXT): rlbasic.o $(READLINE_LIB) - $(PURIFY) $(CC) $(LDFLAGS) -o $@ rlbasic.o $(READLINE_LIB) $(TERMCAP_LIB) + $(CC) $(LDFLAGS) -o $@ rlbasic.o $(READLINE_LIB) $(TERMCAP_LIB) rlcat$(EXEEXT): rlcat.o $(READLINE_LIB) - $(PURIFY) $(CC) $(LDFLAGS) -o $@ rlcat.o $(READLINE_LIB) $(TERMCAP_LIB) + $(CC) $(LDFLAGS) -o $@ rlcat.o $(READLINE_LIB) $(TERMCAP_LIB) rlevent$(EXEEXT): rlevent.o $(READLINE_LIB) - $(PURIFY) $(CC) $(LDFLAGS) -o $@ rlevent.o $(READLINE_LIB) $(TERMCAP_LIB) + $(CC) $(LDFLAGS) -o $@ rlevent.o $(READLINE_LIB) $(TERMCAP_LIB) fileman$(EXEEXT): fileman.o $(READLINE_LIB) - $(PURIFY) $(CC) $(LDFLAGS) -o $@ fileman.o $(READLINE_LIB) $(TERMCAP_LIB) + $(CC) $(LDFLAGS) -o $@ fileman.o $(READLINE_LIB) $(TERMCAP_LIB) rltest$(EXEEXT): rltest.o $(READLINE_LIB) - $(PURIFY) $(CC) $(LDFLAGS) -o $@ rltest.o $(READLINE_LIB) $(TERMCAP_LIB) + $(CC) $(LDFLAGS) -o $@ rltest.o $(READLINE_LIB) $(TERMCAP_LIB) rl-callbacktest$(EXEEXT): rl-callbacktest.o $(READLINE_LIB) - $(PURIFY) $(CC) $(LDFLAGS) -o $@ rl-callbacktest.o $(READLINE_LIB) $(TERMCAP_LIB) + $(CC) $(LDFLAGS) -o $@ rl-callbacktest.o $(READLINE_LIB) $(TERMCAP_LIB) rlptytest$(EXEEXT): rlptytest.o $(READLINE_LIB) - $(PURIFY) $(CC) $(LDFLAGS) -o $@ rlptytest.o $(READLINE_LIB) $(TERMCAP_LIB) + $(CC) $(LDFLAGS) -o $@ rlptytest.o $(READLINE_LIB) $(TERMCAP_LIB) rlversion$(EXEEXT): rlversion.o $(READLINE_LIB) $(CC) $(LDFLAGS) -o $@ rlversion.o $(READLINE_LIB) $(TERMCAP_LIB) histexamp$(EXEEXT): histexamp.o $(HISTORY_LIB) - $(PURIFY) $(CC) $(LDFLAGS) -o $@ histexamp.o -lhistory $(TERMCAP_LIB) + $(CC) $(LDFLAGS) -o $@ histexamp.o -lhistory $(TERMCAP_LIB) hist_erasedups$(EXEEXT): hist_erasedups.o $(HISTORY_LIB) - $(PURIFY) $(CC) $(LDFLAGS) -o $@ hist_erasedups.o -lhistory $(TERMCAP_LIB) + $(CC) $(LDFLAGS) -o $@ hist_erasedups.o -lhistory $(TERMCAP_LIB) hist_purgecmd$(EXEEXT): hist_purgecmd.o $(HISTORY_LIB) - $(PURIFY) $(CC) $(LDFLAGS) -o $@ hist_purgecmd.o -lhistory $(TERMCAP_LIB) + $(CC) $(LDFLAGS) -o $@ hist_purgecmd.o -lhistory $(TERMCAP_LIB) clean mostlyclean: $(RM) $(OBJECTS) $(OTHEROBJ) diff --git a/input.c b/input.c index bbb3947..84faf5a 100644 --- a/input.c +++ b/input.c @@ -1,6 +1,6 @@ /* input.c -- character input functions for readline. */ -/* Copyright (C) 1994-2013 Free Software Foundation, Inc. +/* Copyright (C) 1994-2015 Free Software Foundation, Inc. This file is part of the GNU Readline Library (Readline), a library for reading lines of text with interactive input and history editing. @@ -216,8 +216,8 @@ rl_gather_tyi () #endif result = -1; -#if defined (FIONREAD) errno = 0; +#if defined (FIONREAD) result = ioctl (tty, FIONREAD, &chars_avail); if (result == -1 && errno == EIO) return -1; @@ -236,6 +236,8 @@ rl_gather_tyi () fcntl (tty, F_SETFL, tem); if (chars_avail == -1 && errno == EAGAIN) return 0; + if (chars_avail == -1 && errno == EIO) + return -1; if (chars_avail == 0) /* EOF */ { rl_stuff_char (EOF); @@ -464,7 +466,7 @@ rl_read_key () if ((r = rl_gather_tyi ()) < 0) /* XXX - EIO */ { rl_done = 1; - return ('\n'); + return (errno == EIO ? (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF) : '\n'); } else if (r > 0) /* read something */ continue; diff --git a/misc.c b/misc.c index a890cda..c1adff8 100644 --- a/misc.c +++ b/misc.c @@ -128,7 +128,7 @@ _rl_arg_dispatch (cxt, c) /* If we see a key bound to `universal-argument' after seeing digits, it ends the argument but is otherwise ignored. */ - if (_rl_keymap[c].type == ISFUNC && _rl_keymap[c].function == rl_universal_argument) + if (c >= 0 && _rl_keymap[c].type == ISFUNC && _rl_keymap[c].function == rl_universal_argument) { if ((cxt & NUM_SAWDIGITS) == 0) { @@ -268,6 +268,8 @@ _rl_arg_callback (cxt) int c, r; c = _rl_arg_getchar (); + if (c < 0) + return (1); /* EOF */ if (_rl_argcxt & NUM_READONE) { diff --git a/text.c b/text.c index f2bb224..c623e0b 100644 --- a/text.c +++ b/text.c @@ -610,7 +610,7 @@ rl_skip_csi_sequence (count, key) while (ch >= 0x20 && ch < 0x40); RL_UNSETSTATE (RL_STATE_MOREINPUT); - return 0; + return (ch < 0); } int @@ -622,6 +622,8 @@ rl_arrow_keys (count, c) RL_SETSTATE(RL_STATE_MOREINPUT); ch = rl_read_key (); RL_UNSETSTATE(RL_STATE_MOREINPUT); + if (ch < 0) + return (1); switch (_rl_to_upper (ch)) { @@ -925,7 +927,12 @@ rl_insert (count, c) } if (n != (unsigned short)-2) /* -2 = sentinel value for having inserted N */ - r = rl_execute_next (n); + { + /* setting rl_pending_input inhibits setting rl_last_func so we do it + ourselves here */ + rl_last_func = rl_insert; + r = rl_execute_next (n); + } return r; } diff --git a/vi_mode.c b/vi_mode.c index f4cce5d..c3fa334 100644 --- a/vi_mode.c +++ b/vi_mode.c @@ -1280,8 +1280,8 @@ _rl_vi_domove_callback (m) int c, r; m->motion = c = rl_vi_domove_getchar (m); - /* XXX - what to do if this returns -1? Should we return 1 for eof to - callback code? */ + if (c < 0) + return 1; /* EOF */ r = rl_domove_read_callback (m); return ((r == 0) ? r : 1); /* normalize return values */