From 94f428da790ece6a4039824e58eef9f5cad5171f Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Tue, 3 Nov 2020 11:01:16 -0500 Subject: [PATCH] commit bash-20201030 snapshot --- CHANGES | 5 +++-- CHANGES-5.1 | 5 +++-- CWRU/CWRU.chlog | 20 ++++++++++++++++++++ MANIFEST | 1 + NEWS | 3 ++- NEWS-5.1 | 3 ++- lib/glob/glob.c | 2 +- lib/readline/isearch.c | 4 +++- tests/RUN-ONE-TEST | 2 +- tests/glob.right | 2 +- tests/glob.tests | 1 + tests/glob9.sub | 9 +++++++++ 12 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 tests/glob9.sub diff --git a/CHANGES b/CHANGES index ef80e17e..57e4dd3e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,5 @@ This document details the changes between this version, bash-5.1-rc2, and -the previous version, bash-5.1-beta. +the previous version, bash-5.1-rc1. 1. Changes to Bash @@ -599,7 +599,8 @@ e. rl-clear-display: new bindable command that clears the screen and, if f. New active mark and face feature: when enabled, it will highlight the text inserted by a bracketed paste (the `active region') and the text found by - incremental and non-incremental history searches. + incremental and non-incremental history searches. This is tied to bracketed + paste and can be disabled by turning off bracketed paste. g. Readline sets the mark in several additional commands. diff --git a/CHANGES-5.1 b/CHANGES-5.1 index 438cbc8b..1a22ed77 100644 --- a/CHANGES-5.1 +++ b/CHANGES-5.1 @@ -1,5 +1,5 @@ This document details the changes between this version, bash-5.1-rc2, and -the previous version, bash-5.1-beta. +the previous version, bash-5.1-rc1. 1. Changes to Bash @@ -595,7 +595,8 @@ e. rl-clear-display: new bindable command that clears the screen and, if f. New active mark and face feature: when enabled, it will highlight the text inserted by a bracketed paste (the `active region') and the text found by - incremental and non-incremental history searches. + incremental and non-incremental history searches. This is tied to bracketed + paste and can be disabled by turning off bracketed paste. g. Readline sets the mark in several additional commands. diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 33b37a35..edb74c8f 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -9133,3 +9133,23 @@ lib/readline/isearch.c doc/bash.1,lib/readline/rluser.texi - enable-bracketed-paste: change to note the the current default is `On' + + 10/30 + ----- +lib/glob/glob.c + - wdequote_pathname: if wcsrtombs fails, make sure to check whether it + leaves wpathname set to a non-NULL value before checking whether or + not *wpathname is a null character (indicating an incomplete + conversion). Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972286 + with an assist from Bernhard Übelacker + + 11/1 + ---- +lib/readline/isearch.c + - _rl_isearch_dispatch: when checking whether the current character is + one of the isearch `opcodes', only check the multibyte character + member of CXT if we're currently running in a multibyte locale. Don't + assume that other parts of the code will set mb[0] = c and mb[1] = 0. + Report from Detlef Vollmann + +[bash-5.1-rc2 frozen] diff --git a/MANIFEST b/MANIFEST index bb1c0ac9..54f327cf 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1118,6 +1118,7 @@ tests/glob5.sub f tests/glob6.sub f tests/glob7.sub f tests/glob8.sub f +tests/glob9.sub f tests/glob.right f tests/globstar.tests f tests/globstar.right f diff --git a/NEWS b/NEWS index f59dfa21..a6170be8 100644 --- a/NEWS +++ b/NEWS @@ -167,7 +167,8 @@ e. rl-clear-display: new bindable command that clears the screen and, if f. New active mark and face feature: when enabled, it will highlight the text inserted by a bracketed paste (the `active region') and the text found by - incremental and non-incremental history searches. + incremental and non-incremental history searches. This is tied to bracketed + paste and can be disabled by turning off bracketed paste. g. Readline sets the mark in several additional commands. diff --git a/NEWS-5.1 b/NEWS-5.1 index 16b8fa32..90b0193b 100644 --- a/NEWS-5.1 +++ b/NEWS-5.1 @@ -167,7 +167,8 @@ e. rl-clear-display: new bindable command that clears the screen and, if f. New active mark and face feature: when enabled, it will highlight the text inserted by a bracketed paste (the `active region') and the text found by - incremental and non-incremental history searches. + incremental and non-incremental history searches. This is tied to bracketed + paste and can be disabled by turning off bracketed paste. g. Readline sets the mark in several additional commands. diff --git a/lib/glob/glob.c b/lib/glob/glob.c index c6f35933..eb6277f0 100644 --- a/lib/glob/glob.c +++ b/lib/glob/glob.c @@ -484,7 +484,7 @@ wdequote_pathname (pathname) /* Convert the wide character string into unibyte character set. */ memset (&ps, '\0', sizeof(mbstate_t)); n = wcsrtombs(pathname, (const wchar_t **)&wpathname, len, &ps); - if (n == (size_t)-1 || *wpathname != 0) /* what? now you tell me? */ + if (n == (size_t)-1 || (wpathname && *wpathname != 0)) /* what? now you tell me? */ { wpathname = orig_wpathname; memset (&ps, '\0', sizeof(mbstate_t)); diff --git a/lib/readline/isearch.c b/lib/readline/isearch.c index 8c841f76..ef65e5f5 100644 --- a/lib/readline/isearch.c +++ b/lib/readline/isearch.c @@ -418,9 +418,11 @@ add_character: { /* If we have a multibyte character, see if it's bound to something that affects the search. */ - if (cxt->mb[1]) +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && cxt->mb[1]) f = rl_function_of_keyseq (cxt->mb, cxt->keymap, (int *)NULL); else +#endif { f = cxt->keymap[c].function; if (f == rl_do_lowercase_version) diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST index 0b063810..c8bef8dd 100755 --- a/tests/RUN-ONE-TEST +++ b/tests/RUN-ONE-TEST @@ -1,4 +1,4 @@ -BUILD_DIR=/usr/local/build/chet/bash/bash-current +BUILD_DIR=/usr/local/build/bash/bash-current THIS_SH=$BUILD_DIR/bash PATH=$PATH:$BUILD_DIR diff --git a/tests/glob.right b/tests/glob.right index 8ba1acfe..8f4db354 100644 --- a/tests/glob.right +++ b/tests/glob.right @@ -133,7 +133,7 @@ argv[2] = argv[3] = argv[4] = tmp/l1 tmp/l2 tmp/*4 tmp/l3 -./glob.tests: line 64: no match: tmp/*4 +./glob.tests: line 65: no match: tmp/*4 argv[1] = argv[1] = <*> argv[1] = diff --git a/tests/glob.tests b/tests/glob.tests index 9005e4de..b35d7336 100644 --- a/tests/glob.tests +++ b/tests/glob.tests @@ -29,6 +29,7 @@ ${THIS_SH} ./glob5.sub ${THIS_SH} ./glob6.sub ${THIS_SH} ./glob7.sub ${THIS_SH} ./glob8.sub +${THIS_SH} ./glob9.sub MYDIR=$PWD # save where we are diff --git a/tests/glob9.sub b/tests/glob9.sub new file mode 100644 index 00000000..50105e52 --- /dev/null +++ b/tests/glob9.sub @@ -0,0 +1,9 @@ +LANG=en_US.UTF-8 # safest +: ${TMPDIR:=/var/tmp} +HOME=${TMPDIR} + +mkdir ~/ಇಳಿಕೆಗಳು +touch ~/ಇಳಿಕೆಗಳು/{a,b}.txt +echo ~/ಇಳಿಕೆಗಳು/*.txt >/dev/null + +rm -rf ${TMPDIR}/ಇಳಿಕೆಗಳು