away and "dhms" appears in the format string. Don't return
EX_DISKFALLBACK under any circumstances
+ 11/30
+ -----
+
+builtins/wait.def
+ - wait_builtin: refer to unset_waitlist only if JOB_CONTROL is enabled.
+ Report from Joel Ebel <jbebel@google.com>
+
+parse.y,builtins/set.def
+ - changes for minimal config restrictions
+
+configure.ac,config.h.in
+ - --enable-translatable-strings: new configuration option to allow
+ $"..." support to be compiled in or out; not included in the minimal
+ shell configuration
+
+shell.c
+ - main: don't include any of the dump-strings options if
+ TRANSLATABLE_STRINGS is not defined
+lib/sh/shquote.c
+ - sh_backslash_quote_for_double_quotes: needed for translatable strings
+
+parse.y
+ - support for translating $"..." strings now conditional on
+ TRANSLATABLE_STRINGS
+
+locale.c
+ - locale_expand: now conditional on TRANSLATABLE_STRINGS
+
+subst.c
+ - expand_string_dollar_quote: support for $"..." now conditional on
+ TRANSLATABLE_STRINGS
+
+doc/bashref.texi
+ - --enable-translatable-strings: document new configuration option
else if (unset_function && nameref)
nameref = 0;
+#if defined (ARRAY_VARS)
base_vflags = assoc_expand_once ? VA_NOEXPAND : 0;
+#endif
while (list)
{
last_command_exit_signal = wait_signal_received;
status = 128 + wait_signal_received;
wait_sigint_cleanup ();
+#if defined (JOB_CONTROL)
if (wflags & JWAIT_WAITING)
unset_waitlist ();
+#endif
WAIT_RETURN (status);
}
in array2.c */
#undef ALT_ARRAY_IMPLEMENTATION
+/* Support for $"..." translatable strings. */
+#undef TRANSLATABLE_STRINGS
+
/* Additional defines for configuring lib/intl, maintained by autoscan/autoheader */
/* Define if you have the <argz.h> header file. */
#! /bin/sh
-# From configure.ac for Bash 5.2, version 5.036.
+# From configure.ac for Bash 5.2, version 5.038.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for bash 5.2-devel.
#
enable_separate_helpfiles
enable_single_help_strings
enable_strict_posix_default
+enable_translatable_strings
enable_usg_echo_default
enable_xpg_echo_default
enable_mem_scramble
translation
--enable-strict-posix-default
configure bash to be posix-conformant by default
+ --enable-translatable-strings
+ include support for $"..." translatable strings
--enable-usg-echo-default
a synonym for --enable-xpg-echo-default
--enable-xpg-echo-default
opt_function_import=yes
opt_dev_fd_stat_broken=no
opt_alt_array_impl=no
+opt_translatable_strings=yes
ARRAY_O=array.o
opt_net_redirs=no opt_progcomp=no opt_separate_help=no
opt_multibyte=yes opt_cond_regexp=no opt_coproc=no
opt_casemod_attrs=no opt_casemod_expansions=no opt_extglob_default=no
+ opt_translatable_strings=no
opt_globascii_default=yes
fi
enableval=$enable_strict_posix_default; opt_strict_posix=$enableval
fi
+# Check whether --enable-translatable-strings was given.
+if test ${enable_translatable_strings+y}
+then :
+ enableval=$enable_translatable_strings; opt_translatable_strings=$enableval
+fi
+
# Check whether --enable-usg-echo-default was given.
if test ${enable_usg_echo_default+y}
then :
printf "%s\n" "#define ALT_ARRAY_IMPLEMENTATION 1" >>confdefs.h
ARRAY_O=array2.o
+fi
+if test $opt_translatable_strings = yes; then
+printf "%s\n" "#define TRANSLATABLE_STRINGS 1" >>confdefs.h
+
fi
if test $opt_memscramble = yes; then
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-AC_REVISION([for Bash 5.2, version 5.036])dnl
+AC_REVISION([for Bash 5.2, version 5.038])dnl
define(bashvers, 5.2)
define(relstatus, devel)
opt_function_import=yes
opt_dev_fd_stat_broken=no
opt_alt_array_impl=no
+opt_translatable_strings=yes
dnl modified by alternate array implementation option
ARRAY_O=array.o
opt_net_redirs=no opt_progcomp=no opt_separate_help=no
opt_multibyte=yes opt_cond_regexp=no opt_coproc=no
opt_casemod_attrs=no opt_casemod_expansions=no opt_extglob_default=no
+ opt_translatable_strings=no
opt_globascii_default=yes
fi
AC_ARG_ENABLE(separate-helpfiles, AS_HELP_STRING([--enable-separate-helpfiles], [use external files for help builtin documentation]), opt_separate_help=$enableval)
AC_ARG_ENABLE(single-help-strings, AS_HELP_STRING([--enable-single-help-strings], [store help documentation as a single string to ease translation]), opt_single_longdoc_strings=$enableval)
AC_ARG_ENABLE(strict-posix-default, AS_HELP_STRING([--enable-strict-posix-default], [configure bash to be posix-conformant by default]), opt_strict_posix=$enableval)
+AC_ARG_ENABLE(translatable-strings, AS_HELP_STRING([--enable-translatable-strings], [include support for $"..." translatable strings]), opt_translatable_strings=$enableval)
AC_ARG_ENABLE(usg-echo-default, AS_HELP_STRING([--enable-usg-echo-default], [a synonym for --enable-xpg-echo-default]), opt_xpg_echo=$enableval)
AC_ARG_ENABLE(xpg-echo-default, AS_HELP_STRING([--enable-xpg-echo-default], [make the echo builtin expand escape sequences by default]), opt_xpg_echo=$enableval)
AC_DEFINE(ALT_ARRAY_IMPLEMENTATION)
ARRAY_O=array2.o
fi
+if test $opt_translatable_strings = yes; then
+AC_DEFINE(TRANSLATABLE_STRINGS)
+fi
if test $opt_memscramble = yes; then
AC_DEFINE(MEMSCRAMBLE)
'--enable-strict-posix-default'
Make Bash POSIX-conformant by default (*note Bash POSIX Mode::).
+'--enable-translatable-strings'
+ Enable support for '$"STRING"' translatable strings (*note Locale
+ Translation::).
+
'--enable-usg-echo-default'
A synonym for '--enable-xpg-echo-default'.
Node: Sharing Defaults\7f449284
Node: Operation Controls\7f449957
Node: Optional Features\7f450915
-Node: Reporting Bugs\7f462008
-Node: Major Differences From The Bourne Shell\7f463283
-Node: GNU Free Documentation License\7f480133
-Node: Indexes\7f505310
-Node: Builtin Index\7f505764
-Node: Reserved Word Index\7f512591
-Node: Variable Index\7f515039
-Node: Function Index\7f531531
-Node: Concept Index\7f545315
+Node: Reporting Bugs\7f462133
+Node: Major Differences From The Bourne Shell\7f463408
+Node: GNU Free Documentation License\7f480258
+Node: Indexes\7f505435
+Node: Builtin Index\7f505889
+Node: Reserved Word Index\7f512716
+Node: Variable Index\7f515164
+Node: Function Index\7f531656
+Node: Concept Index\7f545440
\1f
End Tag Table
@item --enable-strict-posix-default
Make Bash @sc{posix}-conformant by default (@pxref{Bash POSIX Mode}).
+@item --enable-translatable-strings
+Enable support for @code{$"@var{string}"} translatable strings
+(@pxref{Locale Translation}).
+
@item --enable-usg-echo-default
A synonym for @code{--enable-xpg-echo-default}.
-/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
+/*
+ Copyright (C) 2021 Free Software Foundation, Inc.
+
+ This file is part of GNU Bash.
+ Bash is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bash is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
/* getconf.h -- replacement definitions for ones the system doesn't provide
and don't appear in <typemax.h> */
/* multiply the accumulated value by the multiplier */
t = accumusec * mult;
- accumsec = accumsec * mult + t / 1000000;
+ accumsec = accumsec * mult + (t / 1000000);
accumusec = t % 1000000;
/* add to running total */
return (result);
}
-#if defined (PROMPT_STRING_DECODE)
+#if defined (PROMPT_STRING_DECODE) || defined (TRANSLATABLE_STRINGS)
/* Quote characters that get special treatment when in double quotes in STRING
using backslashes. Return a new string. */
char *
return 1;
}
+#if defined (TRANSLATABLE_STRINGS)
/* Translate the contents of STRING, a $"..." quoted string, according
to the current locale. In the `C' or `POSIX' locale, or if gettext()
is not available, the passed string is returned unchanged. The
return (temp);
}
}
+#endif
/* Set every character in the <blank> character class to be a shell break
character for the lexical analyzer when the locale changes. */
extern int extended_glob;
#endif
+#if defined (TRANSLATABLE_STRINGS)
extern int dump_translatable_strings, dump_po_strings;
extern int singlequote_translations;
+#endif /* TRANSLATABLE_STRINGS */
#if !defined (errno)
extern int errno;
static void shell_ungetc PARAMS((int));
static void discard_until PARAMS((int));
-#if defined (ALIAS) || defined (DPAREN_ARITHMETIC)
static void push_string PARAMS((char *, int, alias_t *));
static void pop_string PARAMS((void));
static void free_string_list PARAMS((void));
-#endif
static char *read_a_line PARAMS((int));
* everything between a `;;' and the next `)' or `esac'
*/
-#if defined (ALIAS) || defined (DPAREN_ARITHMETIC)
-
#define END_OF_ALIAS 0
/*
shell_input_line_len = pushed_string_list->saved_line_len;
shell_input_line_terminator = pushed_string_list->saved_line_terminator;
+#if defined (ALIAS)
if (pushed_string_list->expand_alias)
parser_state |= PST_ALEXPNEXT;
else
parser_state &= ~PST_ALEXPNEXT;
+#endif
t = pushed_string_list;
pushed_string_list = pushed_string_list->next;
pushed_string_list = (STRING_SAVER *)NULL;
}
-#endif /* ALIAS || DPAREN_ARITHMETIC */
-
void
free_pushed_string_input ()
{
#endif
pop_alias:
- /* This case works for PSH_DPAREN as well */
+#endif /* ALIAS || DPAREN_ARITHMETIC */
+ /* This case works for PSH_DPAREN as well as the shell_ungets() case that uses
+ push_string */
if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE)
{
parser_state &= ~PST_ENDALIAS;
if (uc)
shell_input_line_index++;
}
-#endif /* ALIAS || DPAREN_ARITHMETIC */
if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n')
{
}
retind -= 2; /* back up before the $' */
}
+#if defined (TRANSLATABLE_STRINGS)
else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0))
{
/* Locale expand $"..." here. */
nestlen = strlen (nestret);
retind -= 2; /* back up before the $" */
}
+#endif /* TRANSLATABLE_STRINGS */
APPEND_NESTRET ();
FREE (nestret);
goto next_character;
}
/* This handles $'...' and $"..." new-style quoted strings. */
+#if defined (TRANSLATABLE_STRINGS)
else if MBTEST(character == '$' && (peek_char == '\'' || peek_char == '"'))
+#else
+ else if MBTEST(character == '$' && peek_char == '\'')
+#endif
{
int first_line;
ttranslen = strlen (ttok);
ttrans = ttok;
}
+#if defined (TRANSLATABLE_STRINGS)
else
{
/* PST_NOEXPAND */
ttrans = ttok;
ttranslen = strlen (ttrans);
}
+#endif /* TRANSLATABLE_STRINGS */
RESIZE_MALLOCED_BUFFER (token, token_index, ttranslen + 1,
token_buffer_size,
#else
int no_line_editing = 1; /* can't have line editing without readline */
#endif
+#if defined (TRANSLATABLE_STRINGS)
int dump_translatable_strings; /* Dump strings in $"...", don't execute. */
int dump_po_strings; /* Dump strings in $"..." in po format */
+#endif
int wordexp_only = 0; /* Do word expansion only */
int protected_mode = 0; /* No command substitution with --wordexp */
#if defined (DEBUGGER)
{ "debugger", Int, &debugging_mode, (char **)0x0 },
#endif
+#if defined (TRANSLATABLE_STRINGS)
{ "dump-po-strings", Int, &dump_po_strings, (char **)0x0 },
{ "dump-strings", Int, &dump_translatable_strings, (char **)0x0 },
+#endif
{ "help", Int, &want_initial_help, (char **)0x0 },
{ "init-file", Charp, (int *)0x0, &bashrc_file },
{ "login", Int, &make_login_shell, (char **)0x0 },
set_login_shell ("login_shell", login_shell != 0);
+#if defined (TRANSLATABLE_STRINGS)
if (dump_po_strings)
dump_translatable_strings = 1;
if (dump_translatable_strings)
read_but_dont_execute = 1;
+#endif
if (running_setuid && privileged_mode == 0)
disable_priv_mode ();
break;
case 'D':
+#if defined (TRANSLATABLE_STRINGS)
dump_translatable_strings = 1;
+#endif
break;
default:
case '$':
peekc = string[++sindex];
+#if defined (TRANSLATABLE_STRINGS)
if (peekc != '\'' && peekc != '"')
+#else
+ if (peekc != '\'')
+#endif
{
RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 16);
ret[retind++] = c;
t = sh_single_quote (trans);
sindex = news;
}
+#if defined (TRANSLATABLE_STRINGS)
else
{
news = ++sindex;
t = sh_mkdoublequoted (trans, translen, 0);
sindex = news;
}
+#endif /* TRANSLATABLE_STRINGS */
free (trans);
trans = t;
translen = strlen (trans);
readonly OPTARG
getopts :x x
-echo OPTARG = $OPTARG x = $x
+echo OPTARG = $OPTARG x = "$x"
getopts x x
-echo ${OPTARG-unset} x = $x
+echo ${OPTARG-unset} x = "$x"
typeset -r RO=foo
typeset -n OPTARG=RO
run-ifs-tests|run-input-test|run-invert|run-more-exp|run-nquote) echo $x ; sh $x ;;
run-ifs-posix|run-posix2|run-posixpat|run-posixpipe) echo $x ; sh $x ;;
run-precedence|run-quote|run-read|run-rhs-exp|run-strip|run-tilde) echo $x ; sh $x ;;
- run-dynvar) echo $x ; sh $x ;;
- ;;
+ run-dynvar|run-iquote) echo $x ; sh $x ;;
+ run-type|run-comsub-eof|run-comsub-posix) echo $x ; sh $x ;;
*) ;;
esac
rm -f "$BASH_TSTOUT"