updated translations; back out change allowing quoted characters and process substitution words in function names; rework readline change for GNU Hurd and ncurses

This commit is contained in:
Chet Ramey
2025-06-16 13:47:40 -04:00
parent 727b8d3663
commit 0f0cea342e
18 changed files with 1355 additions and 1850 deletions
+1 -1
View File
@@ -438,7 +438,7 @@ vv. Fixed a bug that caused unset not to remove a function named a[b] if
ww. Posix mode doesn't perform function lookup for function names containing
a slash.
xx. <( and >( can now be used in function names.
xx. <( and >( can now be used in function names. [CHANGE REMOVED]
yy. Fixed a bug that caused tilde expansion not to be performed on some
array subscripts.
+1 -1
View File
@@ -438,7 +438,7 @@ vv. Fixed a bug that caused unset not to remove a function named a[b] if
ww. Posix mode doesn't perform function lookup for function names containing
a slash.
xx. <( and >( can now be used in function names.
xx. <( and >( can now be used in function names. [CHANGE REMOVED]
yy. Fixed a bug that caused tilde expansion not to be performed on some
array subscripts.
+18
View File
@@ -11268,3 +11268,21 @@ buildconf.h.in
builtins/mkbuiltins.c
- include buildconf.h instead of having separate defines when
cross-compiling
6/11
----
lib/readline/terminal.c
- rework change from 5/16 to add __gnu_hurd__ to the list of systems
that don't need extern PC/UP/BC
Reported by Joel Ebel <jbebel@google.com> as a static link failure
due to multiply-defined symbols
6/12
----
general.c
- valid_function_word: back out change from 2/4/2023 that allowed
quoted characters in function names.
Inspired by discussion with Robert Elz <kre@munnari.oz.au> and
Koichi Murase <myoga.murase@gmail.com>
+2 -2
View File
@@ -143,8 +143,8 @@ uu. If `exit' is run in a trap and not supplied an exit status argument, it
`top level' and would cause the trap to end (that is, not in a subshell).
This is from Posix interp 1602.
vv. There is a new `fltexpr' builtin to perform floating-point arithmetic
similarly to `let'.
vv. There is a new `fltexpr' loadable builtin to perform floating-point
arithmetic similarly to `let'.
ww. The `install-strip' and `strip' Makefile targets now deal with cross-
compiling.
+2 -2
View File
@@ -143,8 +143,8 @@ uu. If `exit' is run in a trap and not supplied an exit status argument, it
`top level' and would cause the trap to end (that is, not in a subshell).
This is from Posix interp 1602.
vv. There is a new `fltexpr' builtin to perform floating-point arithmetic
similarly to `let'.
vv. There is a new `fltexpr' loadable builtin to perform floating-point
arithmetic similarly to `let'.
ww. The `install-strip' and `strip' Makefile targets now deal with cross-
compiling.
+1
View File
@@ -189,6 +189,7 @@ bashref.pdf: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
# can also use:
# $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
bashref.html: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
$(RM) $@
$(MAKEINFO) --html --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
bash.info: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
+7 -2
View File
@@ -430,7 +430,8 @@ valid_function_name (const char *name, int flags)
/* Return 1 if this is an identifier that can be used as a function name
when declaring a function. We don't allow `$' for historical reasons.
We allow quotes (for now), slashes, and pretty much everything else.
We don't allow quotes (for now), but we allow slashes and pretty much
everything else.
If (FLAGS&4) is non-zero, we check that the name is not one of the POSIX
special builtins (this is the shell enforcing a POSIX application
requirement). We allow reserved words, even though it's unlikely anyone
@@ -446,7 +447,11 @@ valid_function_word (WORD_DESC *word, int flags)
char *name;
name = word->word;
if ((word->flags & W_HASDOLLAR)) /* allow quotes for now */
#if 0 /*TAG: bash-5.4 */
if (word->flags & W_HASDOLLAR) /* allow quotes for now */
#else
if (word->flags & (W_HASDOLLAR|W_QUOTED)) /* don't allow quotes for now */
#endif
{
err_invalidid (name);
return (0);
+5 -10
View File
@@ -105,17 +105,12 @@ static int tcap_initialized;
/* Systems for which PC/BC/UP are defined in the curses library and need an
extern definition here. */
#if !defined (__linux__) && !defined (__gnu_hurd__) && !defined (NCURSES_VERSION)
# define NEED_EXTERN_PC
#endif /* !__linux__ && !__gnu_hurd__ && !NCURSES_VERSION */
#if defined (__EMX__)
# define NEED_EXTERN_PC
#endif
#if defined (NEED_EXTERN_PC)
extern
# endif /* NEED_EXTERN_PC */
# if defined (__EMX__) || defined (NEED_EXTERN_PC)
extern
# endif /* __EMX__ || NEED_EXTERN_PC */
char PC, *BC, *UP;
#endif /* !__linux__ && !NCURSES_VERSION */
/* Some strings to control terminal actions. These are output by tputs (). */
char *_rl_term_clreol;
+4
View File
@@ -5535,7 +5535,11 @@ read_token_word (int character)
strcpy (token + token_index, ttok);
token_index += ttoklen;
FREE (ttok);
#if 0 /*TAG: bash-5.4 kre@munnari.oz.au 6/12/2025 */
dollar_present |= character == '$';
#else
dollar_present = 1;
#endif
all_digit_token = 0;
goto next_character;
}
BIN
View File
Binary file not shown.
+614 -760
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+430 -824
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+248 -236
View File
File diff suppressed because it is too large Load Diff
+7 -5
View File
@@ -60,12 +60,14 @@ rm -f x.sh x.output
cat << \EOF > x.sh
argmax=$(getconf ARG_MAX 2>/dev/null)
if (( argmax <= 0 )); then
argmax=1048576
echo "exec3.sub: getconf ARG_MAX failed, skipping E2BIG test" >&2
exit 1
fi
v=$(echo {1..250000})
while (( ${#v} < $argmax )); do
v+=$(echo {250001..350000})
done
if (( argmax > (2**31) )); then
echo "exec3.sub: ARG_MAX too large: $argmax, skipping E2BIG test" >&2
exit 0
fi
printf -v v %.*u "$argmax" 0
export v
exec ${THIS_SH} </dev/null
EOF
+7 -7
View File
@@ -184,12 +184,12 @@ function a=2 ()
printf "FUNCNAME: %s\n" $FUNCNAME
}
FUNCNAME: a=2
<(:)
<(:) is a function
<(:) ()
{
echo $FUNCNAME
}
./func5.sub: line 44: `<(:)': not a valid identifier
./func5.sub: line 45: <(:): command not found
./func5.sub: line 46: type: <(:): not found
./func5.sub: line 51: `'a b c'': not a valid identifier
./func5.sub: line 52: a b c: command not found
./func5.sub: line 53: type: a b c: not found
posix mode:
type
break is a special shell builtin
@@ -241,7 +241,7 @@ break ()
}
execution
inside function break
./func5.sub: line 86: `break': is a special builtin
./func5.sub: line 94: `break': is a special builtin
!! is a function
!! ()
{
+8
View File
@@ -37,6 +37,7 @@ set +o posix
a\=2
# these are still errors, but one day will not be
<(:) ()
{
echo $FUNCNAME
@@ -44,6 +45,13 @@ a\=2
\<\(:\)
type '<(:)'
'a b c' ()
{
echo function a b c
}
a\ b\ c
type 'a b c'
break()
{
echo inside function $FUNCNAME