check for delimiter_depth being 0 before popping off the stack (reset_parser resets it); make EOFs while reading here-doc delimiters sticky; when reading arith command, push back a character after the first closing paren that isn't a second close paren to fix backslash issue

This commit is contained in:
Chet Ramey
2025-04-30 16:19:08 -04:00
parent 7731dc5c4d
commit 15df599354
4 changed files with 79 additions and 19 deletions
-5
View File
@@ -52,11 +52,6 @@ a = abc
<$'spring\375'>
<summer>
<automn>
<winter>
<$'spring\375'>
<$'\277summer'>
<$'\277'>
<automn>
timeout 1: ok
unset or null 1
timeout 2: ok
+11 -9
View File
@@ -44,14 +44,16 @@ printf '%b\0' winter spring 'summer\0200apple\0200banana\0200cherry' automn |
printf '%b\200' winter 'spring\0375' summer automn |
while IFS= read -rd $'\200' season; do LC_ALL=C printf "<%q>\n" "$season"; done
: ${TMPDIR:=/tmp}
INFILE=$TMPDIR/read-in-$$
printf '%b\243' winter 'spring\0375' '\0277summer' '\0277' automn > $INFILE
# this test is encoding-dependent, and varies from system to system
#: ${TMPDIR:=/tmp}
#INFILE=$TMPDIR/read-in-$$
#printf '%b\243' winter 'spring\0375' '\0277summer' '\0277' automn > $INFILE
#
#LANG=zh_HK.big5hkscs
#while IFS= read -rd $'\243' season; do
# LC_ALL=C printf "<%q>\n" "$season"
#done < $INFILE
#
#rm -f $INFILE
LANG=zh_HK.big5hkscs
while IFS= read -rd $'\243' season; do
LC_ALL=C printf "<%q>\n" "$season"
done < $INFILE
rm -f $INFILE
exit 0