From 4630525106f0a976d34fc946f86e9a407824182a Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Tue, 9 Jun 2020 16:36:30 -0400 Subject: [PATCH] commit bash-20200606 snapshot --- CWRU/CWRU.chlog | 24 ++++++++++++++++++++++++ configure | 30 ++++++++++++++++-------------- configure.ac | 30 ++++++++++++++++-------------- doc/bash.1 | 6 ++++-- doc/bashref.texi | 2 ++ doc/version.texi | 6 +++--- lib/readline/kill.c | 2 +- lib/readline/readline.c | 4 ++++ lib/readline/vi_mode.c | 9 +++++++-- 9 files changed, 77 insertions(+), 36 deletions(-) diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 0e81460e..b48d82f6 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -8528,3 +8528,27 @@ lib/sh/{lots of files}.c include/{lots of files}.h examples/loadables/{lots of files}.c - __P -> PARAMS + +doc/{bash.1,bashref.texi} + - SECONDS: clarify that the number of seconds is always determined by + querying the system clock + + 6/8 + --- +configure.ac + - if CFLAGS is not supplied in the environment or on the command line, + add the gcc options that suppress warnings about parens and print + formats in a slightly different way, that will avoid some collisions + +lib/readline/readline.c + - _rl_dispatch_subseq: don't set rl_last_func to rl_vi_arg_digit, just + the same as if it were rl_digit_argument. This allows functions like + rl_yank_last_arg, which behave differently when called multiple times + in a row, to work closer to what is expected. This allows what + Leo Alekseyev reported to work, with caveats + +lib/readline/vi_mode.c + - rl_vi_yank_arg: make sure to pass `key' to rl_yank_nth_arg, in case + it needs to use it later + - rl_vi_redo: suppress attempts to redo `.' when the current keymap is + vi_movement_keymap, since that will recursively call vi_redo diff --git a/configure b/configure index ed719853..10c97521 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac for Bash 5.1, version 5.018. +# From configure.ac for Bash 5.1, version 5.020. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for bash 5.1-alpha. # @@ -3436,10 +3436,7 @@ fi if test -z "$CFLAGS"; then - AUTO_CFLAGS="-g ${GCC+-O2} ${GCC+-Wno-parentheses}" - AUTO_LDFLAGS="-g ${GCC+-O2}" -else - AUTO_CFLAGS= AUTO_LDFLAGS= + want_auto_cflags=1 fi echo "" @@ -4236,6 +4233,14 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$want_auto_cflags"; then + AUTO_CFLAGS="-g ${GCC+-O2}" + AUTO_LDFLAGS="-g ${GCC+-O2}" + STYLE_CFLAGS="${GCC+-Wno-parentheses} ${GCC+-Wno-format-security}" +else + AUTO_CFLAGS= AUTO_LDFLAGS= STYLE_CFLAGS= +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } @@ -5031,7 +5036,11 @@ if test "X$cross_compiling" = "Xno"; then LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-'$(LDFLAGS)'} fi # CFLAGS set above to default value if not passed in environment - CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'} + if test -n "$want_auto_cflags" ; then + CFLAGS_FOR_BUILD="${CFLAGS} ${STYLE_CFLAGS}" + else + CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'} + fi LIBS_FOR_BUILD=${LIBS_FOR_BUILD-'$(LIBS)'} else CC_FOR_BUILD=${CC_FOR_BUILD-"gcc"} @@ -20424,14 +20433,7 @@ mips-pyramid-sysv4) LOCAL_CFLAGS=-Xa ;; esac # turn off paren warnings in gcc -if test "$GCC" = yes # && test -n "$DEBUG" -then - CFLAGS="$CFLAGS -Wno-parentheses -Wno-format-security" -# if test -n "$DEBUG" -# then -# CFLAGS="$CFLAGS -Werror" -# fi -fi +CFLAGS="$CFLAGS ${STYLE_CFLAGS}" # # Shared object configuration section. These values are generated by diff --git a/configure.ac b/configure.ac index 9b26de4b..f91d6444 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure script. # You should have received a copy of the GNU General Public License # along with this program. If not, see . -AC_REVISION([for Bash 5.1, version 5.018])dnl +AC_REVISION([for Bash 5.1, version 5.020])dnl define(bashvers, 5.1) define(relstatus, alpha) @@ -405,10 +405,7 @@ AC_SUBST(HELPSTRINGS) dnl We want these before the checks, so the checks can modify their values. if test -z "$CFLAGS"; then - AUTO_CFLAGS="-g ${GCC+-O2} ${GCC+-Wno-parentheses}" - AUTO_LDFLAGS="-g ${GCC+-O2}" -else - AUTO_CFLAGS= AUTO_LDFLAGS= + want_auto_cflags=1 fi echo "" @@ -420,6 +417,14 @@ dnl AC_PROG_CC sets $cross_compiling to `yes' if cross-compiling for a dnl different environment AC_PROG_CC +if test -n "$want_auto_cflags"; then + AUTO_CFLAGS="-g ${GCC+-O2}" + AUTO_LDFLAGS="-g ${GCC+-O2}" + STYLE_CFLAGS="${GCC+-Wno-parentheses} ${GCC+-Wno-format-security}" +else + AUTO_CFLAGS= AUTO_LDFLAGS= STYLE_CFLAGS= +fi + dnl test for Unix variants AC_ISC_POSIX AC_MINIX @@ -514,7 +519,11 @@ if test "X$cross_compiling" = "Xno"; then LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-'$(LDFLAGS)'} fi # CFLAGS set above to default value if not passed in environment - CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'} + if test -n "$want_auto_cflags" ; then + CFLAGS_FOR_BUILD="${CFLAGS} ${STYLE_CFLAGS}" + else + CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'} + fi LIBS_FOR_BUILD=${LIBS_FOR_BUILD-'$(LIBS)'} else CC_FOR_BUILD=${CC_FOR_BUILD-"gcc"} @@ -1200,14 +1209,7 @@ mips-pyramid-sysv4) LOCAL_CFLAGS=-Xa ;; esac # turn off paren warnings in gcc -if test "$GCC" = yes # && test -n "$DEBUG" -then - CFLAGS="$CFLAGS -Wno-parentheses -Wno-format-security" -# if test -n "$DEBUG" -# then -# CFLAGS="$CFLAGS -Werror" -# fi -fi +CFLAGS="$CFLAGS ${STYLE_CFLAGS}" # # Shared object configuration section. These values are generated by diff --git a/doc/bash.1 b/doc/bash.1 index defe1e38..b7ff0d05 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -5,12 +5,12 @@ .\" Case Western Reserve University .\" chet.ramey@case.edu .\" -.\" Last Change: Sat May 23 12:45:10 EDT 2020 +.\" Last Change: Fri Jun 5 14:46:57 EDT 2020 .\" .\" bash_builtins, strip all but Built-Ins section .if \n(zZ=1 .ig zZ .if \n(zY=1 .ig zY -.TH BASH 1 "2020 May 23" "GNU Bash 5.1" +.TH BASH 1 "2020 June 5" "GNU Bash 5.1" .\" .\" There's some problem with having a `@' .\" in a tagged paragraph with the BSD man macros. @@ -1975,6 +1975,8 @@ value is assigned to the value returned upon subsequent references is the number of seconds since the assignment plus the value assigned. +The number of seconds at shell invocation and the current time is always +determined by querying the system clock. If .SM .B SECONDS diff --git a/doc/bashref.texi b/doc/bashref.texi index 9741eee8..be251fde 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -6351,6 +6351,8 @@ shell was started. Assignment to this variable resets the count to the value assigned, and the expanded value becomes the value assigned plus the number of seconds since the assignment. +The number of seconds at shell invocation and the current time is always +determined by querying the system clock. If @env{SECONDS} is unset, it loses its special properties, even if it is subsequently reset. diff --git a/doc/version.texi b/doc/version.texi index 6b3ed86f..835bbd75 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -2,10 +2,10 @@ Copyright (C) 1988-2020 Free Software Foundation, Inc. @end ignore -@set LASTCHANGE Sat May 23 12:45:30 EDT 2020 +@set LASTCHANGE Fri Jun 5 14:48:45 EDT 2020 @set EDITION 5.1 @set VERSION 5.1 -@set UPDATED 23 May 2020 -@set UPDATED-MONTH May 2020 +@set UPDATED 5 June 2020 +@set UPDATED-MONTH June 2020 diff --git a/lib/readline/kill.c b/lib/readline/kill.c index 285e32df..e9d52502 100644 --- a/lib/readline/kill.c +++ b/lib/readline/kill.c @@ -606,7 +606,7 @@ rl_yank_nth_arg_internal (int count, int key, int history_skip) #if defined (VI_MODE) /* Vi mode always inserts a space before yanking the argument, and it inserts it right *after* rl_point. */ - if (rl_editing_mode == vi_mode) + if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap) { rl_vi_append_mode (1, key); rl_insert_text (" "); diff --git a/lib/readline/readline.c b/lib/readline/readline.c index ed5c4283..800eb119 100644 --- a/lib/readline/readline.c +++ b/lib/readline/readline.c @@ -890,7 +890,11 @@ _rl_dispatch_subseq (register int key, Keymap map, int got_subseq) /* If we have input pending, then the last command was a prefix command. Don't change the state of rl_last_func. Otherwise, remember the last command executed in this variable. */ +#if defined (VI_MODE) + if (rl_pending_input == 0 && map[key].function != rl_digit_argument && map[key].function != rl_vi_arg_digit) +#else if (rl_pending_input == 0 && map[key].function != rl_digit_argument) +#endif rl_last_func = map[key].function; RL_CHECK_SIGNALS (); diff --git a/lib/readline/vi_mode.c b/lib/readline/vi_mode.c index 47af84b7..a5ec2f8b 100644 --- a/lib/readline/vi_mode.c +++ b/lib/readline/vi_mode.c @@ -298,6 +298,11 @@ rl_vi_redo (int count, int c) if (rl_point > 0) _rl_vi_backup (); } + else if (_rl_vi_last_command == '.' && _rl_keymap == vi_movement_keymap) + { + rl_ding (); + r = 0; + } else r = _rl_dispatch (_rl_vi_last_command, _rl_keymap); @@ -320,9 +325,9 @@ rl_vi_yank_arg (int count, int key) /* Readline thinks that the first word on a line is the 0th, while vi thinks the first word on a line is the 1st. Compensate. */ if (rl_explicit_arg) - rl_yank_nth_arg (count - 1, 0); + rl_yank_nth_arg (count - 1, key); else - rl_yank_nth_arg ('$', 0); + rl_yank_nth_arg ('$', key); return (0); }