Re: "printf %d ''" should diagnose the empty string

2024-11-21 Thread Martin D Kealey
On Thu, 21 Nov 2024 at 02:33, Paul Eggert wrote: there's little reason for Bash's non-POSIX mode to differ. > 1. One person's "failure to fail" is another person's "useful undocumented extension". 2. There exist deployed scripts that rely on the current behaviour. Does anyone think these are n

history bug: new shell separates lines from the history file

2024-11-21 Thread Michael Tosch
Hello, I want to file a bug in bash. Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall

[PATCH 14/25] doc/bash.1: Set `-@` argument to `cd` in bold.

2024-11-21 Thread G. Branden Robinson
It's literal, just like the options `-L`, `-P`, and `-e`. --- doc/bash.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/bash.1 b/doc/bash.1 index 342ad823..d547c330 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -8987,9 +8987,9 @@ .SH "SHELL BUILTIN COMMANDS" call stack.

[PATCH 22/25] doc/bash.1: Drop extraneous interword spaces.

2024-11-21 Thread G. Branden Robinson
--- doc/bash.1 | 4 ++-- doc/bashref.texi | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/bash.1 b/doc/bash.1 index dd58e0d1..160c7b50 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -4102,7 +4102,7 @@ .SS Word Splitting and passed to commands as empty strings. Unquo

[PATCH 05/25] doc/bash.1, doc/bashref.texi: Resync.

2024-11-21 Thread G. Branden Robinson
Break lines in similar places; this eases diffing. Also apply wording changes that didn't get reflected in bashref.texi or bash.1, preferring whichever edit was more recent. --- doc/bash.1 | 74 +-- doc/bashref.texi | 153 +--

[PATCH 07/25] doc/bashref.texi: Add internal cross reference.

2024-11-21 Thread G. Branden Robinson
bash.1 has one in the same place. --- doc/bashref.texi | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/bashref.texi b/doc/bashref.texi index 2be71c2d..e8db1bfe 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -8435,6 +8435,7 @@ @node Top declare -a @var{name} @end example @noinde

[PATCH 08/25] doc/bashref.texi: Use typesetter's quotation marks.

2024-11-21 Thread G. Branden Robinson
--- doc/bashref.texi | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/bashref.texi b/doc/bashref.texi index e8db1bfe..ffaa863b 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -7068,9 +7068,10 @@ @node Top The @samp{numeric} specifier treats names consisting

[PATCH 06/25] doc/bash.1: Resync with lib/readline/doc/readline.3.

2024-11-21 Thread G. Branden Robinson
Break lines in similar places; this eases diffing. Apply wording change that didn't get reflected in bash.1, and correct inadvertently boldfaced text. --- doc/bash.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/bash.1 b/doc/bash.1 index 9afddaf3..9223dd46 100644 -

[PATCH 01/25] Adjust style of "export-completions" documentation.

2024-11-21 Thread G. Branden Robinson
* doc/bash.1: + Drop explicit `sp` request in favor of inter-paragraph spacing. + Set items returned by Readline command as bulleted list. + Identify "N" as the parameter replaced by the number of matches. + Set "readline" in boldface, for consistency with rest of page. + Set parameters "

[PATCH 04/25] doc/bash.1, doc/bashref.texi: Align wording.

2024-11-21 Thread G. Branden Robinson
* Perform Kemper notectomy. * Break lines in the same places to ease diffing. * Align verb tenses. --- doc/bash.1 | 11 ++- doc/bashref.texi | 40 ++-- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/doc/bash.1 b/doc/bash.1 index 6

[PATCH 03/25] doc/bash.1: Clarify program/man page reference.

2024-11-21 Thread G. Branden Robinson
This way the novice is less likely to think the plain English word "more" is meant here. --- doc/bash.1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/bash.1 b/doc/bash.1 index 23a8dbd6..6c864eab 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -6962,7 +6962,8 @@ .SS "Readlin

[PATCH 02/25] doc/bash.1: Document approach to conditional text.

2024-11-21 Thread G. Branden Robinson
Also ensure the controlling registers are initialized without changing their values, avoiding groff "reg" warnings. Similarly, define the end macros used as end macros in `ig` requests as empty, avoiding groff "mac" warnings. Fixes: $ nroff -ww -z -man ./doc/bash.1 troff:./doc/bash.1:13: warning:

[PATCH 09/25] doc/bashref.texi: Favor present tense over future.

2024-11-21 Thread G. Branden Robinson
--- doc/bashref.texi | 103 +-- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/doc/bashref.texi b/doc/bashref.texi index ffaa863b..74581695 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -554,7 +554,7 @@ @node Top Prefixing a

[PATCH 10/25] doc/bash.1: Remove stray *roff syntax.

2024-11-21 Thread G. Branden Robinson
No string named `/` is defined in this document. Fixes: troff:./doc/bash.1:5221: warning: macro '/' not defined --- doc/bash.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/bash.1 b/doc/bash.1 index 9223dd46..036ab2ae 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -52

[PATCH 17/25] Respell "C-J" with a lowercase j.

2024-11-21 Thread G. Branden Robinson
...like every other documented Control+letter combination. --- doc/bash.1 | 6 +++--- lib/readline/doc/readline.3 | 6 +++--- lib/readline/doc/rluser.texi | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/bash.1 b/doc/bash.1 index 658bed68..f700a736 10

[PATCH 12/25] lib/readline/doc/history.3: Silence groff warning.

2024-11-21 Thread G. Branden Robinson
...without interfering with the test for DWB man(7) we do subsequently. Fixes: $ nroff -ww -z -man ./lib/readline/doc/history.3 troff:./lib/readline/doc/history.3:29: warning: register ')Y' not defined --- lib/readline/doc/history.3 | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/readline

[PATCH 13/25] lib/readline/doc/history.3: Use consistent style.

2024-11-21 Thread G. Branden Robinson
Set `struct _hist_entry` declaration in a constant-width face on typesetters as is already done with `struct _hist_state`. --- lib/readline/doc/history.3 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/readline/doc/history.3 b/lib/readline/doc/history.3 index 09d5ee21..e236bb15 100644 --

[PATCH 18/25] Style keyboard literals consistently.

2024-11-21 Thread G. Branden Robinson
Use italics for them, not bold, to align with the preponderance of usage. Also use man(7) font style alternation macros instead of *roff escape sequences for adjacent roman and italic type. In groff man(7), this gets you automatic italic corrections. Sync rluser.texi's input line break points wi

[PATCH 19/25] Spell key sequences with spaces, not hyphens.

2024-11-21 Thread G. Branden Robinson
The hyphen indicates simultaneity, not sequence. Also use Texinfo `kbd` command to denote key strokes in parallel material in rluser.texi. --- doc/bash.1 | 9 ++--- lib/readline/doc/readline.3 | 9 ++--- lib/readline/doc/rluser.texi | 7 +-- 3 files changed, 17 inse

[PATCH 16/25] Document common arrow key bindings.

2024-11-21 Thread G. Branden Robinson
--- doc/bash.1 | 4 lib/readline/doc/readline.3 | 2 ++ lib/readline/doc/rluser.texi | 4 3 files changed, 10 insertions(+) diff --git a/doc/bash.1 b/doc/bash.1 index d547c330..658bed68 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -7251,9 +7251,11 @@ .SS Commands for M

[PATCH 20/25] Fix missing interword spaces.

2024-11-21 Thread G. Branden Robinson
--- doc/bash.1 | 3 ++- lib/readline/doc/readline.3 | 3 ++- lib/readline/doc/rluser.texi | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/bash.1 b/doc/bash.1 index fe87c7e7..c6d60aa9 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -6448,7 +6448,8 @@ .SS "

[PATCH 24/25] doc/bash.1: Protect some literals from hyphenation.

2024-11-21 Thread G. Branden Robinson
Fixes: $ nroff -rLL=80n -man -Tascii doc/bash.1 | grep -E '(FUNC|INPU)-' ists only when a shell function is executing. Assignments to FUNC- BASH_SOURCE to describe the call stack. For instance, ${FUNC- inputrc file). The name of this file is taken from the val

[PATCH 15/25] lib/readline/doc/*.3: Use local `Q` macro for quotation.

2024-11-21 Thread G. Branden Robinson
--- lib/readline/doc/history.3 | 8 ++-- lib/readline/doc/readline.3 | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/readline/doc/history.3 b/lib/readline/doc/history.3 index e236bb15..381d1fb5 100644 --- a/lib/readline/doc/history.3 +++ b/lib/readline/doc/history

[PATCH 21/25] Improve presentation of symbolic character names.

2024-11-21 Thread G. Branden Robinson
Since so many are synonymous, say so and organize them into pairs. Sync rluser.texi's wording with that of bash.1 and readline.3. --- doc/bash.1 | 28 +--- lib/readline/doc/readline.3 | 28 +--- lib/readline/doc/rluser.texi | 28 +

[PATCH 11/25] Synchronize comments on *roff syntax.

2024-11-21 Thread G. Branden Robinson
Clarify what's "not usable", and make parallel between the man pages. --- doc/bash.1 | 6 -- lib/readline/doc/history.3 | 9 - lib/readline/doc/readline.3 | 9 - 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/doc/bash.1 b/doc/bash.1 index 036a

[PATCH 25/25] Style redirection operators consistently.

2024-11-21 Thread G. Branden Robinson
In bash.1, set them in bold like other operators in this document. Also escape their hyphens. Use `Q` local quotation macro to quote individual characters of a redirection operator where these are called out for discussion. This is also a better parallel with bashref.texi's use of the Texinfo `s

[PATCH 23/25] Fix which/that grammar nit.

2024-11-21 Thread G. Branden Robinson
Use "that", not "which", with restrictive clause. --- doc/bash.1 | 2 +- lib/readline/doc/readline.3 | 2 +- lib/readline/doc/rluser.texi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/bash.1 b/doc/bash.1 index 160c7b50..f44d156e 100644 --- a/doc/bash

Re: "printf %d ''" should diagnose the empty string

2024-11-21 Thread Paul Eggert
On 2024-11-20 23:25, Martin D Kealey wrote: 2. There exist deployed scripts that rely on the current behaviour. Where? Any such scripts won't work on other shell implementations that do conform to POSIX here. This behaviour is entirely consistent with strtol(arg,&end,0) where you only che