]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sh: Do not allow overriding a special builtin with a function.
authorjilles <jilles@FreeBSD.org>
Sun, 24 Oct 2010 22:03:21 +0000 (22:03 +0000)
committerjilles <jilles@FreeBSD.org>
Sun, 24 Oct 2010 22:03:21 +0000 (22:03 +0000)
commit58038d3e9e1f45ea4dccdfeb21e3f9bb40ae4950
treec67a589303115497405ea6d6c7c7ed067acf7e9f
parent520543ca439ef2838b69c6bf1e321ba7ce98debf
sh: Do not allow overriding a special builtin with a function.
This is a syntax error.

POSIX does not say explicitly whether defining a function with the same name
as a special builtin is allowed, but it does say that it is impossible to
call such a function.

A special builtin can still be overridden with an alias.

This commit is part of a set of changes that will ensure that when
something looks like a special builtin to the parser, it is one. (Not the
other way around, as it remains possible to call a special builtin named
by a variable or other substitution.)

Exp-run done by: pav (with some other sh(1) changes)
bin/sh/parser.c
tools/regression/bin/sh/execution/func3.0 [new file with mode: 0644]