From e9e3e4fea56f9459705542ac39884650fb4c6007 Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Tue, 26 Jul 2022 11:44:09 -0400 Subject: [PATCH] fixed gcc printf warning; fixed typos in comments and support files --- CHANGES | 47 ++++++++++++++++++++++++++++--- CHANGES-5.2 | 39 +++++++++++++++++++++++++ CWRU/CWRU.chlog | 8 ++++++ MANIFEST | 2 +- NEWS | 7 +++-- NEWS-5.2 | 3 ++ builtins/setattr.def | 2 +- doc/FAQ | 2 +- doc/article.txt | 4 +-- doc/bashref.texi | 6 ++-- examples/functions/autoload.v4 | 4 +-- examples/functions/csh-compat | 2 +- examples/loadables/fdflags.c | 4 +-- examples/loadables/mkdir.c | 2 +- findcmd.c | 2 +- lib/readline/doc/rltech.texi | 2 +- lib/readline/examples/rlptytest.c | 2 +- print_cmd.c | 2 +- subst.c | 2 +- support/signames.c | 4 +-- tests/RUN-ONE-TEST | 2 +- tests/printf1.sub | 2 +- 22 files changed, 120 insertions(+), 30 deletions(-) diff --git a/CHANGES b/CHANGES index e9f9b2c9..ef680643 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,42 @@ +This document details the changes between this version, bash-5.2-rc2, and +the previous version, bash-5.2-rc1. + +1. Changes to Bash + +a. Fixed a bug that could disable history saving after a compound array + assignment in an interactive shell. + +b. Fixed a bug that could cause incorrect error messages when running a DEBUG + trap during a conditional or arithmetic command. + +c. Fixed a bug that caused test to print an error message when given ! ! arg + as arguments. + +d. Fixed a bug that resulted in incorrect error messages when completing a + backquoted command substitution. + +e. Changed command substitution parsing to reproduce the original text more + closely when reconsituting the command string from the parsed command. + +f. Fixed a bug that could cause an EXIT trap to use the wrong variable context + when the errexit option is set. + +g. Fixed a bug that could cause the parser to incorrectly delimit a token when + an alias expansion ended with a multibyte character. + +2. Changes to Readline + +3. New Features in Bash + +a. Since there is no `declare -' equivalent of `local -', make sure to use + `local -' in the output of `local -p'. + +b. Null anchored matches in pattern substitution now process `&' in the + replacement string, like sed. + +4. New Features in Readline + +------------------------------------------------------------------------------ This document details the changes between this version, bash-5.2-rc1, and the previous version, bash-5.2-beta. @@ -4474,7 +4513,7 @@ l. There is a new configuration option (in config-top.h) that forces bash to m. A new variable $BASHOPTS to export shell options settable using `shopt' to child processes. -n. There is a new confgure option that forces the extglob option to be +n. There is a new configure option that forces the extglob option to be enabled by default. o. New variable $BASH_XTRACEFD; when set to an integer bash will write xtrace @@ -4515,7 +4554,7 @@ d. New bindable function: skip-csi-sequence. Can be used as a default to to bind all keys. e. New application-settable function: rl_filename_rewrite_hook. Can be used - to rewite or modify filenames read from the file system before they are + to rewrite or modify filenames read from the file system before they are compared to the word to be completed. f. New bindable variable: skip-completed-text, active when completing in the @@ -4597,7 +4636,7 @@ and the previous version, bash-4.0-beta2. 1. Changes to Bash a. Fixed a bug that caused parsing errors when a $()-style command - substitution was follwed immediately by a quoted newline. + substitution was followed immediately by a quoted newline. b. Fixed a bug that caused extended shell globbing patterns beginning with `*(' to not work when used with pattern substitution word expansions. @@ -9533,7 +9572,7 @@ gg. `alias' and `unalias' now print error messages when passed an argument not interactive, as POSIX.2 specifies. hh. `alias' and `alias -p' now return a status of 0 when no aliases are - defined, as POSIX.2 specifes. + defined, as POSIX.2 specifies. ii. `cd -' now prints the pathname of the new working directory if the shell is interactive. diff --git a/CHANGES-5.2 b/CHANGES-5.2 index cf8b9dc9..262cd6f5 100644 --- a/CHANGES-5.2 +++ b/CHANGES-5.2 @@ -1,3 +1,42 @@ +This document details the changes between this version, bash-5.2-rc2, and +the previous version, bash-5.2-rc1. + +1. Changes to Bash + +a. Fixed a bug that could disable history saving after a compound array + assignment in an interactive shell. + +b. Fixed a bug that could cause incorrect error messages when running a DEBUG + trap during a conditional or arithmetic command. + +c. Fixed a bug that caused test to print an error message when given ! ! arg + as arguments. + +d. Fixed a bug that resulted in incorrect error messages when completing a + backquoted command substitution. + +e. Changed command substitution parsing to reproduce the original text more + closely when reconsituting the command string from the parsed command. + +f. Fixed a bug that could cause an EXIT trap to use the wrong variable context + when the errexit option is set. + +g. Fixed a bug that could cause the parser to incorrectly delimit a token when + an alias expansion ended with a multibyte character. + +2. Changes to Readline + +3. New Features in Bash + +a. Since there is no `declare -' equivalent of `local -', make sure to use + `local -' in the output of `local -p'. + +b. Null anchored matches in pattern substitution now process `&' in the + replacement string, like sed. + +4. New Features in Readline + +------------------------------------------------------------------------------ This document details the changes between this version, bash-5.2-rc1, and the previous version, bash-5.2-beta. diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 1c1cfed5..8d6e8f9d 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -3687,6 +3687,8 @@ print_cmd.c configure.ac - bumped version to bash-5.2-rc1 +[bash-5.2-rc1 released] + 6/15 ---- parse.y @@ -3742,6 +3744,7 @@ print_cmd.c command substitution and calls make_command_string - make_command_string_internal: add '\n' to the ';' case; print command list with newline connector appropriately + parse.y - parse_comsub: call print_comsub instead of make_command_string - list1 production (part of compound_list): if a list is separated by @@ -3813,3 +3816,8 @@ subst.c presented with a null string: process the replacement string for `&' and `\&' and substitute in the result as before. Patch from Koichi Murase + + 7/20 + ---- + +[bash-5.2-rc2 frozen] diff --git a/MANIFEST b/MANIFEST index cbe97c64..ee8b0c7e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -210,7 +210,7 @@ builtins/psize.sh f builtins/bashgetopt.c f builtins/common.h f builtins/bashgetopt.h f -cross-build/cygwin32.cache f +#cross-build/cygwin32.cache f cross-build/x86-beos.cache f cross-build/opennt.cache f cross-build/qnx.cache f diff --git a/NEWS b/NEWS index 95234c5b..31bb6616 100644 --- a/NEWS +++ b/NEWS @@ -112,6 +112,9 @@ ee. The `globbing' completion code now takes the `globstar' option into account. ff. `suspend -f' now forces the shell to suspend even if job control is not currently enabled. +gg. Since there is no `declare -' equivalent of `local -', make sure to use + `local -' in the output of `local -p'. + 2. New Features in Readline a. There is now an HS_HISTORY_VERSION containing the version number of the @@ -1080,7 +1083,7 @@ l. There is a new configuration option (in config-top.h) that forces bash to m. A new variable $BASHOPTS to export shell options settable using `shopt' to child processes. -n. There is a new confgure option that forces the extglob option to be +n. There is a new configure option that forces the extglob option to be enabled by default. o. New variable $BASH_XTRACEFD; when set to an integer bash will write xtrace @@ -1127,7 +1130,7 @@ d. New bindable function: skip-csi-sequence. Can be used as a default to to bind all keys. e. New application-settable function: rl_filename_rewrite_hook. Can be used - to rewite or modify filenames read from the file system before they are + to rewrite or modify filenames read from the file system before they are compared to the word to be completed. f. New bindable variable: skip-completed-text, active when completing in the diff --git a/NEWS-5.2 b/NEWS-5.2 index 567a9f3b..e685e0af 100644 --- a/NEWS-5.2 +++ b/NEWS-5.2 @@ -112,6 +112,9 @@ ee. The `globbing' completion code now takes the `globstar' option into account. ff. `suspend -f' now forces the shell to suspend even if job control is not currently enabled. +gg. Since there is no `declare -' equivalent of `local -', make sure to use + `local -' in the output of `local -p'. + 2. New Features in Readline a. There is now an HS_HISTORY_VERSION containing the version number of the diff --git a/builtins/setattr.def b/builtins/setattr.def index f2df3a6e..50c8edf6 100644 --- a/builtins/setattr.def +++ b/builtins/setattr.def @@ -376,7 +376,7 @@ show_all_var_attributes (v, nodefs) } /* Show all local variable variables with their attributes. This shows unset - local variables (all_local_variables called with 0 argment). */ + local variables (all_local_variables called with 0 argument). */ int show_local_var_attributes (v, nodefs) int v, nodefs; diff --git a/doc/FAQ b/doc/FAQ index 06c6fffd..44be0a6d 100644 --- a/doc/FAQ +++ b/doc/FAQ @@ -633,7 +633,7 @@ o There is a new configuration option (in config-top.h) that forces bash to o A new variable $BASHOPTS to export shell options settable using `shopt' to child processes. -o There is a new confgure option that forces the extglob option to be +o There is a new configure option that forces the extglob option to be enabled by default. o New variable $BASH_XTRACEFD; when set to an integer bash will write xtrace diff --git a/doc/article.txt b/doc/article.txt index c19ff924..e43ca9f3 100644 --- a/doc/article.txt +++ b/doc/article.txt @@ -531,7 +531,7 @@ _c_o_m_m_a_n_d _h_i_s_t_o_r_y) is provided jointly by Bash readline library. Bash provides variables ($HISTFILE, $HISTSIZE, and $HISTCONTROL) and the _h_i_s_t_o_r_y and _f_c builtins to manipulate the history list. The value of $_H_I_S_T_F_I_L_E -specifes the file where Bash writes the command history on +specifies the file where Bash writes the command history on exit and reads it on startup. $_H_I_S_T_S_I_Z_E is used to limit the number of commands saved in the history. $_H_I_S_T_C_O_N_T_R_O_L provides a crude form of control over which commands are @@ -1107,5 +1107,3 @@ Inc. October 28, 1994 - - diff --git a/doc/bashref.texi b/doc/bashref.texi index e7a92d5a..661ce81d 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -8410,7 +8410,7 @@ If Bash receives a trapped signal while executing @code{read}, the trap handler executes and @code{read} returns an exit status greater than 128. @item -The @code{printf} builting uses @code{double} (via @code{strtod}) to convert +The @code{printf} builtin uses @code{double} (via @code{strtod}) to convert arguments corresponding to floating point conversion specifiers, instead of @code{long double} if it's available. The @samp{L} length modifier forces @code{printf} to use @code{long double} if it's available. @@ -8892,7 +8892,7 @@ The variable will be unset initially, before any assignment. This is useful only when the @option{-n} option is supplied. Supplying the @option{-f} option, when job control is enabled, forces @code{wait} to wait for each @var{pid} or @var{jobspec} to -terminate before returning its status, intead of returning when it changes +terminate before returning its status, instead of returning when it changes status. If neither @var{jobspec} nor @var{pid} specifies an active child process of the shell, the return status is 127. @@ -9329,7 +9329,7 @@ the installed version of Readline in subdirectories of that directory @item --with-libintl-prefix[=@var{PREFIX}] Define this to make Bash link with a locally-installed version of the -libintl library instead ofthe version in @file{lib/intl}. +libintl library instead of the version in @file{lib/intl}. @item --with-libiconv-prefix[=@var{PREFIX}] Define this to make Bash look for libiconv in @var{PREFIX} instead of the diff --git a/examples/functions/autoload.v4 b/examples/functions/autoload.v4 index 7f60563b..850c6148 100644 --- a/examples/functions/autoload.v4 +++ b/examples/functions/autoload.v4 @@ -427,7 +427,7 @@ NOTES bypass the shim creation and just source in the function's file directly. For a few calls, the overhead of repeatedly running the shim is not expensive, but in a tight loop, it might be. Caveat - Programer. + Programmer. o Although the number of functions in the environment does not change by using 'autoload', the amount of memory they take up can be greatly @@ -453,7 +453,7 @@ NOTES the simplest to implement for -p and -s operations that are not heavily used. - As a consquence of this (and other reasons), the AUTOLOAD* namespace + As a consequence of this (and other reasons), the AUTOLOAD* namespace is reserved for autoloading. Make sure you check any functions that you bring under autoload for use of variables or functions that start with AUTOLOAD and change them. diff --git a/examples/functions/csh-compat b/examples/functions/csh-compat index 54c8488c..6671ca85 100644 --- a/examples/functions/csh-compat +++ b/examples/functions/csh-compat @@ -1,4 +1,4 @@ -# C-shell compatibilty package. +# C-shell compatibility package. # setenv VAR VALUE function setenv () { diff --git a/examples/loadables/fdflags.c b/examples/loadables/fdflags.c index fbe52304..9f2d089f 100644 --- a/examples/loadables/fdflags.c +++ b/examples/loadables/fdflags.c @@ -3,7 +3,7 @@ /* See Makefile for compilation details. */ /* - Copyright (C) 2017,2018,2019 Free Software Foundation, Inc. + Copyright (C) 2017-2022 Free Software Foundation, Inc. This file is part of GNU Bash. Bash is free software: you can redistribute it and/or modify @@ -102,7 +102,7 @@ static const struct # define ALLFLAGS (O_APPEND|O_ASYNC|O_SYNC|O_NONBLOCK|O_FSYNC|O_DSYNC|\ O_RSYNC|O_ALT_IO|O_DIRECT|O_NOATIME|O_NOSIGPIPE) -/* An unsed bit in the file status flags word we can use to pass around the +/* An unused bit in the file status flags word we can use to pass around the state of close-on-exec. */ # define O_CLOEXEC ((~ALLFLAGS) ^ ((~ALLFLAGS) & ((~ALLFLAGS) - 1))) #endif diff --git a/examples/loadables/mkdir.c b/examples/loadables/mkdir.c index d5d39551..a5b49309 100644 --- a/examples/loadables/mkdir.c +++ b/examples/loadables/mkdir.c @@ -228,7 +228,7 @@ char *mkdir_doc[] = { "a symbolic mode is used, the operations are interpreted relative to", "an initial mode of \"a=rwx\". The -p option causes any required", "intermediate directories in PATH to be created. The directories", - "are created with permssion bits of rwxrwxrwx as modified by the current", + "are created with permission bits of rwxrwxrwx as modified by the current", "umask, plus write and search permissions for the owner. mkdir", "returns 0 if the directories are created successfully, and non-zero", "if an error occurs.", diff --git a/findcmd.c b/findcmd.c index 0bf20796..95f231e5 100644 --- a/findcmd.c +++ b/findcmd.c @@ -109,7 +109,7 @@ exec_name_should_ignore (name) /* Return some flags based on information about this file. The EXISTS bit is non-zero if the file is found. - The EXECABLE bit is non-zero the file is executble. + The EXECABLE bit is non-zero the file is executable. Zero is returned if the file is not found. */ int file_status (name) diff --git a/lib/readline/doc/rltech.texi b/lib/readline/doc/rltech.texi index fe64a42c..95a57b6d 100644 --- a/lib/readline/doc/rltech.texi +++ b/lib/readline/doc/rltech.texi @@ -1184,7 +1184,7 @@ Returns the old timeout value. @deftypefun int rl_set_timeout (unsigned int secs, unsigned int usecs) Set a timeout for subsequent calls to @code{readline()}. If Readline does not read a complete line, or the number of characters specified by -@code{rl_num_chars_to_read}, before the duration specfied by @var{secs} +@code{rl_num_chars_to_read}, before the duration specified by @var{secs} (in seconds) and @var{usecs} (microseconds), it returns and sets @code{RL_STATE_TIMEOUT} in @code{rl_readline_state}. Passing 0 for @code{secs} and @code{usecs} cancels any previously set diff --git a/lib/readline/examples/rlptytest.c b/lib/readline/examples/rlptytest.c index 0008dd1f..d170f62f 100644 --- a/lib/readline/examples/rlptytest.c +++ b/lib/readline/examples/rlptytest.c @@ -224,7 +224,7 @@ static enum { RESET, TCBREAK } ttystate = RESET; * * fd - The file descriptor of the terminal * - * Returns: 0 on sucess, -1 on error + * Returns: 0 on success, -1 on error */ int tty_cbreak(int fd){ struct termios buf; diff --git a/print_cmd.c b/print_cmd.c index 6e84d0ce..eef9bb6a 100644 --- a/print_cmd.c +++ b/print_cmd.c @@ -304,7 +304,7 @@ make_command_string_internal (command) if (deferred_heredocs == 0) { if (was_heredoc == 0) - cprintf (s); /* inside_function_def? */ + cprintf ("%s", s); /* inside_function_def? */ else was_heredoc = 0; } diff --git a/subst.c b/subst.c index f3980166..f2987a51 100644 --- a/subst.c +++ b/subst.c @@ -8627,7 +8627,7 @@ valid_parameter_transform (xform) case 'P': /* expand like prompt string */ case 'Q': /* quote reusably */ case 'U': /* transform to uppercase */ - case 'u': /* tranform by capitalizing */ + case 'u': /* transform by capitalizing */ case 'L': /* transform to lowercase */ return 1; default: diff --git a/support/signames.c b/support/signames.c index 35ecf441..84864fd7 100644 --- a/support/signames.c +++ b/support/signames.c @@ -84,9 +84,9 @@ initialize_signames () names first. This allows (for example) SIGABRT to overwrite SIGLOST. */ /* POSIX 1003.1b-1993 real time signals, but take care of incomplete - implementations. Acoording to the standard, both, SIGRTMIN and + implementations. According to the standard, both SIGRTMIN and SIGRTMAX must be defined, SIGRTMIN must be strictly less than - SIGRTMAX, and the difference must be at least 7, that is, there + SIGRTMAX, and the difference must be at least 7; that is, there must be at least eight distinct real time signals. */ /* The generated signal names are SIGRTMIN, SIGRTMIN+1, ..., diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST index c8bef8dd..0b063810 100755 --- a/tests/RUN-ONE-TEST +++ b/tests/RUN-ONE-TEST @@ -1,4 +1,4 @@ -BUILD_DIR=/usr/local/build/bash/bash-current +BUILD_DIR=/usr/local/build/chet/bash/bash-current THIS_SH=$BUILD_DIR/bash PATH=$PATH:$BUILD_DIR diff --git a/tests/printf1.sub b/tests/printf1.sub index e4fb54b8..2cbbc6a6 100644 --- a/tests/printf1.sub +++ b/tests/printf1.sub @@ -24,7 +24,7 @@ printf "%s" "$vv" printf -v vv "one\ctwo\n" printf "%s" "$vv" -# and unrecognized backslash escapes should have the backslash preserverd +# and unrecognized backslash escapes should have the backslash preserved printf -v vv "4\.2\n" printf "%s" "$vv"