commit bash-20210215 snapshot

This commit is contained in:
Chet Ramey
2021-02-17 15:31:03 -05:00
parent a6c3a43f43
commit a7309caba4
13 changed files with 1769 additions and 1352 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -259,5 +259,5 @@ efg
42
42
42
./arith.tests: line 327: 'foo' : syntax error: operand expected (error token is "'foo' ")
./arith.tests: line 331: b[c]d: syntax error in expression (error token is "d")
./arith.tests: line 330: 'foo' : syntax error: operand expected (error token is "'foo' ")
./arith.tests: line 333: b[c]d: syntax error in expression (error token is "d")
+3 -1
View File
@@ -322,10 +322,12 @@ printf "%u\n" $n
echo $(( 16#$(printf "%x\n" $n) ))
echo $(( 16#$(printf "%X\n" $n) ))
# allow reserved words after an arithmetic command just because
if ((expr)) then ((expr)) fi
# these are errors
foo=1
echo $(( 'foo' ))
# causes longjmp botches through bash-2.05b
a[b[c]d]=e
+10
View File
@@ -74,5 +74,15 @@ swap32_posix ()
));
done
}
./comsub-posix5.sub: command substitution: line 38: syntax error near unexpected token `done'
./comsub-posix5.sub: command substitution: line 38: `case x in x) ;; x) done esac)'
./comsub-posix5.sub: command substitution: line 39: syntax error near unexpected token `done'
./comsub-posix5.sub: command substitution: line 39: `case x in x) ;; x) done ;; esac)'
./comsub-posix5.sub: command substitution: line 40: syntax error near unexpected token `esac'
./comsub-posix5.sub: command substitution: line 40: `case x in x) (esac) esac)'
bash: -c: line 1: syntax error near unexpected token `;;'
bash: -c: line 1: `: $(case x in esac|in) foo;; esac)'
bash: -c: line 1: unexpected EOF while looking for matching `)'
bash: -c: line 2: syntax error: unexpected end of file
yes
ab cde
+3
View File
@@ -231,6 +231,9 @@ ${THIS_SH} ./comsub-posix2.sub
${THIS_SH} ./comsub-posix3.sub
#${THIS_SH} ./comsub-posix4.sub
${THIS_SH} ./comsub-posix5.sub
# produced a parse error through bash-4.0-beta2
: $(echo foo)"
"
+68
View File
@@ -0,0 +1,68 @@
# This program 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.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
: ${THIS_SH:=./bash}
# problems with recognzing `esac' after a right paren in a command substitution
: $(case x in x) esac)
: $(case x in x) ;; x) esac)
# non-reserved word beginning with e
: $(case x in x) ;; x) echo ;; esac)
# reserved word beginning with e
: $(case x in x) ;; x) eval esac ;; esac)
: $(case x in x ) esac)
: $(case x in x ) ;; x) esac)
: $(case x in (x) esac)
: $(case x in (x) ;; (x) esac)
: $(case x in (x) ;; x) esac)
: $(case x in (x) (echo a) esac)
: $(case x in (x) (echo esac) esac)
: $(case x in x) (echo esac) esac)
# these errors should be caught sooner
: $(case x in x) ;; x) done esac)
: $(case x in x) ;; x) done ;; esac)
: $(case x in x) (esac) esac)
# these are not errors
: $(case x in x) ;; x) eval done ;; esac)
# these are just ridiculous
: $(case x in (x) a() { echo a; } esac)
: $(case x in (x) if :; then echo a; fi esac)
: $(case x in (x) { echo a; } esac)
: $(case x in (x) while false; do echo a; done esac)
: $(case x in (x) case y in (y) echo a;; esac esac)
: $(case x in (x) case y in (y) echo a;; esac ;; (y) foo ;; esac)
: $(case x in x) a() { echo a; } esac)
: $(case x in x) if :; then echo a; fi esac)
: $(case x in x) { echo a; } esac)
: $(case x in x) while false; do echo a; done esac)
: $(case x in x) case y in (y) echo a;; esac esac)
: $(case x in x) case y in (y) echo a;; esac ;; y) foo ;; esac)
: $(case x in x) case y in y) echo a;; esac ;; y) foo ;; esac)
: $(case ni in esac)
: $(case in in esac)
: $(case x in in|esac) foo;; esac)
# this is an error
${THIS_SH} -c ': $(case x in esac|in) foo;; esac)' bash
${THIS_SH} -c ': $(case x in x) ;; x) done)' bash
+3
View File
@@ -207,6 +207,9 @@ del=$'\177'
[[ "" == "$foo" ]] && echo ok 4
[[ "$del" == "${foo,,}" ]] || echo ok 5
# allow reserved words after a conditional command just because
if [[ str ]] then [[ str ]] fi
${THIS_SH} ./cond-regexp1.sub
${THIS_SH} ./cond-regexp2.sub