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