sh: Reject function names ending in one of !%*+-=?@}~
These do something else in ksh: name=(...) is an array or compound variable assignment and the others are extended patterns. This is the last patch of the ones tested in the exp run. Exp-run done by: pav (with some other sh(1) changes)
This commit is contained in:
parent
34092e2279
commit
038f244ca5
@ -644,9 +644,13 @@ simplecmd(union node **rpp, union node *redir)
|
||||
/*
|
||||
* - Require plain text.
|
||||
* - Functions with '/' cannot be called.
|
||||
* - Reject name=().
|
||||
* - Reject ksh extended glob patterns.
|
||||
*/
|
||||
if (!noexpand(n->narg.text) || quoteflag ||
|
||||
strchr(n->narg.text, '/'))
|
||||
strchr(n->narg.text, '/') ||
|
||||
strchr("!%*+-=?@}~",
|
||||
n->narg.text[strlen(n->narg.text) - 1]))
|
||||
synerror("Bad function name");
|
||||
rmescapes(n->narg.text);
|
||||
if (find_builtin(n->narg.text, &special) >= 0 &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user