]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/parser/line-cont11.0
shell_cmds-198.tar.gz
[apple/shell_cmds.git] / sh / tests / parser / line-cont11.0
1 # $FreeBSD$
2
3 T=$(mktemp "${TMPDIR:-/tmp}/sh-test.XXXXXXXX") || exit
4 trap 'rm -f -- "$T"' 0
5 w='#A'
6 # A naive pgetc_linecont() would push back two characters here, which
7 # fails if a new buffer is read between the two characters.
8 c='${w#\#}'
9 c=$c$c$c$c
10 c=$c$c$c$c
11 c=$c$c$c$c
12 c=$c$c$c$c
13 c=$c$c$c$c
14 c=$c$c$c$c
15 printf 'v=%s\n' "$c" >"$T"
16 . "$T"
17 if [ "${#v}" != 4096 ]; then
18 echo "Length is bad (${#v})"
19 exit 3
20 fi
21 case $v in
22 *[!A]*) echo "Content is bad"; exit 3 ;;
23 esac