line-cont11.0 revision 303975
1# $FreeBSD: releng/11.0/bin/sh/tests/parser/line-cont11.0 273276 2014-10-19 11:59:15Z jilles $ 2 3T=$(mktemp "${TMPDIR:-/tmp}/sh-test.XXXXXXXX") || exit 4trap 'rm -f -- "$T"' 0 5w='#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. 8c='${w#\#}' 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 14c=$c$c$c$c 15printf 'v=%s\n' "$c" >"$T" 16. "$T" 17if [ "${#v}" != 4096 ]; then 18 echo "Length is bad (${#v})" 19 exit 3 20fi 21case $v in 22*[!A]*) echo "Content is bad"; exit 3 ;; 23esac 24