9/23
----
[bash-5.2 frozen]
+
+ 9/26
+ ----
+[bash-5.2 released]
+
+ 9/27
+ ----
+mailcheck.c
+ - time_to_check_mail: don't bother if we're in the middle of readline
+ completion or command dispatching.
+ From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019462
+
+lib/readline/display.c
+ - rl_forced_update_display: use memset to clear out visible_line
+ instead of trying to use a loop; line_size is the size.
+ Report from <srobertson@peratonlabs.com>
+
+print_cmd.c
+ - indirection_level_string: use MBRLEN and an initialized mbstate_t
+ object to avoid altering an internal mbstate_t.
+ From Koichi Murase <myoga.murase@gmail.com>
+
+subst.c
+ - string_extract_verbatim: use an explicit mbstate_t object and pass
+ it to MBRLEN and mbrtowc to avoid altering the state that
+ ADVANCE_CHAR is using.
+ From Koichi Murase <myoga.murase@gmail.com>
+ - setifs: use an explicit mbstate_t object and pass it to MBRLEN so
+ to avoid altering an internal mbstate_t.
+ From Koichi Murase <myoga.murase@gmail.com>
+
+builtins/printf.def
+ - asciicode: use an explicit mbstate_t object and pass it to mbrtowc
+ to avoid using an incorrect internal mbstate_t
+ From Koichi Murase <myoga.murase@gmail.com>
+
+lib/sh/{mbscasecmp,mbscmp}.c
+ - mbscasecmp,mbscmp: use different mbstate_t objects for the different
+ strings so they don't affect each others' intermediate mbstate.
+ From Koichi Murase <myoga.murase@gmail.com>
This file is printf.def, from which is created printf.c.
It implements the builtin "printf" in Bash.
-Copyright (C) 1997-2021 Free Software Foundation, Inc.
+Copyright (C) 1997-2022 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
#if defined (HANDLE_MULTIBYTE)
slen = strlen (garglist->word->word+1);
wc = 0;
- mblength = mbtowc (&wc, garglist->word->word+1, slen);
+ mblength = mbrtowc (&wc, garglist->word->word+1, slen, &state);
if (mblength > 0)
ch = wc; /* XXX */
else
#! /bin/sh
-# From configure.ac for Bash 5.2, version 5.045.
+# From configure.ac for Bash 5.2, version 5.046.
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for bash 5.2-rc4.
+# Generated by GNU Autoconf 2.71 for bash 5.2-maint.
#
# Report bugs to <bug-bash@gnu.org>.
#
# Identity of this package.
PACKAGE_NAME='bash'
PACKAGE_TARNAME='bash'
-PACKAGE_VERSION='5.2-rc4'
-PACKAGE_STRING='bash 5.2-rc4'
+PACKAGE_VERSION='5.2-maint'
+PACKAGE_STRING='bash 5.2-maint'
PACKAGE_BUGREPORT='bug-bash@gnu.org'
PACKAGE_URL=''
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures bash 5.2-rc4 to adapt to many kinds of systems.
+\`configure' configures bash 5.2-maint to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of bash 5.2-rc4:";;
+ short | recursive ) echo "Configuration of bash 5.2-maint:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-bash configure 5.2-rc4
+bash configure 5.2-maint
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by bash $as_me 5.2-rc4, which was
+It was created by bash $as_me 5.2-maint, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
BASHVERS=5.2
-RELSTATUS=rc4
+RELSTATUS=maint
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|releng*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by bash $as_me 5.2-rc4, which was
+This file was extended by bash $as_me 5.2-maint, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-bash config.status 5.2-rc4
+bash config.status 5.2-maint
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
# 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.045])dnl
+AC_REVISION([for Bash 5.2, version 5.046])dnl
define(bashvers, 5.2)
-define(relstatus, rc4)
+define(relstatus, maint)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
/* shmbutil.h -- utility functions for multibyte characters. */
-/* Copyright (C) 2002-2019 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2022 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
if (line_size > minsize)
minsize = line_size;
}
- realloc_line (minsize);
+ realloc_line (minsize);
if (vis_lbreaks == 0)
{
rl_forced_update_display (void)
{
register char *temp;
+ register int tlen;
if (visible_line)
- {
- temp = visible_line;
- while (*temp)
- *temp++ = '\0';
- }
+ memset (visible_line, 0, line_size);
+
rl_on_new_line ();
forced_display++;
(*rl_redisplay_function) ();
/* mbscasecmp - case-insensitive multibyte string comparison. */
-/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2022 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
{
int len1, len2, mb_cur_max;
wchar_t c1, c2, l1, l2;
+ mbstate_t state1 = { 0 }, state2 = { 0 };
len1 = len2 = 0;
- /* Reset multibyte characters to their initial state. */
- (void) mblen ((char *) NULL, 0);
-
mb_cur_max = MB_CUR_MAX;
+
do
{
- len1 = mbtowc (&c1, mbs1, mb_cur_max);
- len2 = mbtowc (&c2, mbs2, mb_cur_max);
+ len1 = mbrtowc (&c1, mbs1, mb_cur_max, &state1);
+ len2 = mbrtowc (&c2, mbs2, mb_cur_max, &state2);
if (len1 == 0)
return len2 == 0 ? 0 : -1;
/* mbscmp - multibyte string comparison. */
-/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2022 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
{
int len1, len2, mb_cur_max;
wchar_t c1, c2;
+ mbstate_t state1 = { 0 }, state2 = { 0 };
len1 = len2 = 0;
- /* Reset multibyte characters to their initial state. */
- (void) mblen ((char *) NULL, 0);
-
mb_cur_max = MB_CUR_MAX;
+
do
{
- len1 = mbtowc (&c1, mbs1, mb_cur_max);
- len2 = mbtowc (&c2, mbs2, mb_cur_max);
+ len1 = mbrtowc (&c1, mbs1, mb_cur_max, &state1);
+ len2 = mbrtowc (&c2, mbs2, mb_cur_max, &state2);
if (len1 == 0)
return len2 == 0 ? 0 : -1;
#include "mailcheck.h"
#include <tilde/tilde.h>
+#if defined (READLINE)
+# include <readline/readline.h>
+#endif
+
/* Values for flags word in struct _fileinfo */
#define MBOX_INITIALIZED 0x01
time_t now;
intmax_t seconds;
+#if defined (READLINE)
+ if (RL_ISSTATE (RL_STATE_COMPLETING|RL_STATE_DISPATCHING))
+ return (0);
+#endif
+
temp = get_string_value ("MAILCHECK");
/* Negative number, or non-numbers (such as empty string) cause no
char *ps4;
char ps4_firstc[MB_LEN_MAX+1];
int ps4_firstc_len, ps4_len, ineed, old;
+ DECLARE_MBSTATE;
ps4 = get_string_value ("PS4");
if (indirection_string == 0)
#if defined (HANDLE_MULTIBYTE)
ps4_len = strnlen (ps4, MB_CUR_MAX);
- ps4_firstc_len = MBLEN (ps4, ps4_len);
+ ps4_firstc_len = MBRLEN (ps4, ps4_len, &state);
if (ps4_firstc_len == 1 || ps4_firstc_len == 0 || ps4_firstc_len < 0)
{
ps4_firstc[0] = ps4[0];
register int i;
#if defined (HANDLE_MULTIBYTE)
wchar_t *wcharlist;
+ mbstate_t mbstmp;
#endif
int c;
char *temp;
if (locale_utf8locale && slen > i && UTF8_SINGLEBYTE (string[i]))
mblength = (string[i] != 0) ? 1 : 0;
else
- mblength = MBLEN (string + i, slen - i);
+ {
+ mbstmp = state;
+ mblength = MBRLEN (string + i, slen - i, &mbstmp);
+ }
if (mblength > 1)
{
wchar_t wc;
- mblength = mbtowc (&wc, string + i, slen - i);
+ mbstmp = state;
+ mblength = mbrtowc (&wc, string + i, slen - i, &mbstmp);
if (MB_INVALIDCH (mblength))
{
if (MEMBER (c, charlist))
else
{
size_t ifs_len;
+ DECLARE_MBSTATE;
ifs_len = strnlen (ifs_value, MB_CUR_MAX);
- ifs_firstc_len = MBLEN (ifs_value, ifs_len);
+ ifs_firstc_len = MBRLEN (ifs_value, ifs_len, &state);
}
if (ifs_firstc_len == 1 || ifs_firstc_len == 0 || MB_INVALIDCH (ifs_firstc_len))
{