readline fix for rl_undo_list pointer aliasing; arith command sets word_top

This commit is contained in:
Chet Ramey
2023-03-06 10:50:45 -05:00
parent 0bd0fb5966
commit 277c21d2b2
14 changed files with 414 additions and 32 deletions
+23
View File
@@ -166,4 +166,27 @@ after FUNCNEST unset: f = 201
./func4.sub: line 23: foo: maximum function nesting level exceeded (20)
1
after FUNCNEST assign: f = 38
11111 ()
{
printf "FUNCNAME: %s\n" $FUNCNAME
}
function a=2 ()
{
printf "FUNCNAME: %s\n" $FUNCNAME
}
function 11111 ()
{
printf "FUNCNAME: %s\n" $FUNCNAME
}
function a=2 ()
{
printf "FUNCNAME: %s\n" $FUNCNAME
}
FUNCNAME: a=2
break is a function
break ()
{
echo FUNCNAME: $FUNCNAME
}
FUNCNAME: break
5
+4
View File
@@ -166,6 +166,7 @@ export -f zf
${THIS_SH} -c 'type -t zf'
${THIS_SH} -c 'type zf'
unset -f zf
${THIS_SH} ./func1.sub
@@ -179,6 +180,9 @@ ${THIS_SH} ./func3.sub
# FUNCNEST testing
${THIS_SH} ./func4.sub
# function naming restrictions
${THIS_SH} ./func5.sub
unset -f myfunction
myfunction() {
echo "bad shell function redirection"
+38
View File
@@ -0,0 +1,38 @@
# 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/>.
#
function a=2
{
printf "FUNCNAME: %s\n" $FUNCNAME
}
function 11111
{
printf "FUNCNAME: %s\n" $FUNCNAME
}
declare -f
set -o posix
declare -f
set +o posix
a\=2
break()
{
echo FUNCNAME: $FUNCNAME
}
type break
\break
+7
View File
@@ -1,5 +1,12 @@
# catch-all for parsing problems that don't fit anywhere else
# word_top issues in bash-5.2
case x in x) if ((1)); then :; fi ;; esac
case x in x) if ((1)); then :; fi esac
case x in x) if ((true ) ); then :; fi ;; esac
case x in x) if ((true ) ); then :; fi esac
# this has to be in a separate file to get desired EOF behavior
${THIS_SH} ./parser1.sub