freebsd-dev/tools/regression/bin/sh/parser/heredoc6.0
Jilles Tjoelker 5d91007000 sh: Fix a crash if a heredoc was not properly ended and parsing continued.
Example (in interactive mode):
  cat <<EOF && )
The next command typed caused sh to segfault, because the state for the here
document was not reset.

Like parser_temp, this uses the fact that the parser is not re-entered.
2010-05-30 14:20:32 +00:00

6 lines
97 B
Plaintext

# $FreeBSD$
r=
! command eval ": <<EOF; )" 2>/dev/null; command eval : hi \${r:=0}
exit ${r:-3}