aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-07-04 14:35:41 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2023-07-04 14:38:25 +0200
commit07a95cfcabb0706a22599b4440b495b6cfa8123e (patch)
treeee074cb7517d0d2673fb3563cbd19ed4f8e5ed40 /shell/hush.c
parente5692e2342c68092ee3d4d895ea847cf7d13fa57 (diff)
downloadbusybox-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/hush.c')
-rw-r--r--shell/hush.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index ec4f3a2f2..1b7e546fa 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -4306,7 +4306,7 @@ static int done_word(struct parse_context *ctx)
4306 || endofname(command->argv[0])[0] != '\0' 4306 || endofname(command->argv[0])[0] != '\0'
4307 ) { 4307 ) {
4308 /* bash says just "not a valid identifier" */ 4308 /* bash says just "not a valid identifier" */
4309 syntax_error("bad variable name in for"); 4309 syntax_error("bad for loop variable");
4310 return 1; 4310 return 1;
4311 } 4311 }
4312 /* Force FOR to have just one word (variable name) */ 4312 /* Force FOR to have just one word (variable name) */
@@ -4683,6 +4683,11 @@ static int parse_group(struct parse_context *ctx,
4683 syntax_error_unexpected_ch(ch); 4683 syntax_error_unexpected_ch(ch);
4684 return -1; 4684 return -1;
4685 } 4685 }
4686//bash allows functions named "123", "..", "return"!
4687// if (endofname(command->argv[0])[0] != '\0') {
4688// syntax_error("bad function name");
4689// return -1;
4690// }
4686 nommu_addchr(&ctx->as_string, ch); 4691 nommu_addchr(&ctx->as_string, ch);
4687 command->cmd_type = CMD_FUNCDEF; 4692 command->cmd_type = CMD_FUNCDEF;
4688 goto skip; 4693 goto skip;