]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sh: Fix crash with empty functions (f() { }) introduced in r196483
authorJilles Tjoelker <jilles@FreeBSD.org>
Fri, 28 Aug 2009 22:41:25 +0000 (22:41 +0000)
committerJilles Tjoelker <jilles@FreeBSD.org>
Fri, 28 Aug 2009 22:41:25 +0000 (22:41 +0000)
commite16947f83d758544093c5709d58be72bd4d25522
tree7a8084b831c46519ff07655affc5c604f115d66a
parenta99fcfd4ca91f6fc8cd17f665933648559172adf
sh: Fix crash with empty functions (f() { }) introduced in r196483

Empty pairs of braces are represented by a NULL node pointer, just like
empty lines at the top level.

Support for empty pairs of braces may be removed later. They make the code
more complex, have inconsistent behaviour (may or may not change $?), are
not specified by POSIX and are not allowed by some other shells like bash,
dash and ksh93.

Reported by: kan
bin/sh/eval.c
bin/sh/exec.c
bin/sh/mknodes.c
bin/sh/nodes.c.pat
tools/regression/bin/sh/execution/func2.0 [new file with mode: 0644]