diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2023-07-04 14:35:41 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2023-07-04 14:38:25 +0200 |
commit | 07a95cfcabb0706a22599b4440b495b6cfa8123e (patch) | |
tree | ee074cb7517d0d2673fb3563cbd19ed4f8e5ed40 /shell/ash.c | |
parent | e5692e2342c68092ee3d4d895ea847cf7d13fa57 (diff) | |
download | busybox-w32-07a95cfcabb0706a22599b4440b495b6cfa8123e.tar.gz busybox-w32-07a95cfcabb0706a22599b4440b495b6cfa8123e.tar.bz2 busybox-w32-07a95cfcabb0706a22599b4440b495b6cfa8123e.zip |
ash: disable check for "good" function name, bash does not check this
function old new delta
.rodata 105304 105261 -43
parse_command 1696 1633 -63
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-106) Total: -106 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/shell/ash.c b/shell/ash.c index 96d2433d3..e91566994 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -12123,18 +12123,19 @@ simplecmd(void) | |||
12123 | if (args && app == &args->narg.next | 12123 | if (args && app == &args->narg.next |
12124 | && !vars && !redir | 12124 | && !vars && !redir |
12125 | ) { | 12125 | ) { |
12126 | struct builtincmd *bcmd; | 12126 | // struct builtincmd *bcmd; |
12127 | const char *name; | 12127 | // const char *name; |
12128 | 12128 | ||
12129 | /* We have a function */ | 12129 | /* We have a function */ |
12130 | if (IF_BASH_FUNCTION(!function_flag &&) readtoken() != TRP) | 12130 | if (IF_BASH_FUNCTION(!function_flag &&) readtoken() != TRP) |
12131 | raise_error_unexpected_syntax(TRP); | 12131 | raise_error_unexpected_syntax(TRP); |
12132 | name = n->narg.text; | 12132 | //bash allows functions named "123", "..", "return"! |
12133 | if (!goodname(name) | 12133 | // name = n->narg.text; |
12134 | || ((bcmd = find_builtin(name)) && IS_BUILTIN_SPECIAL(bcmd)) | 12134 | // if (!goodname(name) |
12135 | ) { | 12135 | // || ((bcmd = find_builtin(name)) && IS_BUILTIN_SPECIAL(bcmd)) |
12136 | raise_error_syntax("bad function name"); | 12136 | // ) { |
12137 | } | 12137 | // raise_error_syntax("bad function name"); |
12138 | // } | ||
12138 | n->type = NDEFUN; | 12139 | n->type = NDEFUN; |
12139 | checkkwd = CHKNL | CHKKWD | CHKALIAS; | 12140 | checkkwd = CHKNL | CHKKWD | CHKALIAS; |
12140 | n->ndefun.text = n->narg.text; | 12141 | n->ndefun.text = n->narg.text; |