freebsd-nq/bin/sh/tests/builtins/lineno2.0
Jilles Tjoelker 5439648913 sh: Do not corrupt internal representation if LINENO inner expansion fails.
Example:
  f() { : ${LINENO+$((1/0))}; }
and call this function twice.
2014-02-27 16:54:43 +00:00

11 lines
95 B
Plaintext

# $FreeBSD$
f() {
: ${LINENO+${x?}}
}
unset -v x
command eval f 2>/dev/null && exit 3
x=1
f