~vcs-imports/busybox/trunk

« back to all changes in this revision

Viewing changes to shell/hush.c

  • Committer: Denys Vlasenko
  • Date: 2023-07-04 12:38:25 UTC
  • Revision ID: git-v1:07a95cfcabb0706a22599b4440b495b6cfa8123e
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>

Show diffs side-by-side

added added

removed removed

Lines of Context:
4306
4306
                 || endofname(command->argv[0])[0] != '\0'
4307
4307
                ) {
4308
4308
                        /* bash says just "not a valid identifier" */
4309
 
                        syntax_error("bad variable name in for");
 
4309
                        syntax_error("bad for loop variable");
4310
4310
                        return 1;
4311
4311
                }
4312
4312
                /* Force FOR to have just one word (variable name) */
4683
4683
                        syntax_error_unexpected_ch(ch);
4684
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
4691
                nommu_addchr(&ctx->as_string, ch);
4687
4692
                command->cmd_type = CMD_FUNCDEF;
4688
4693
                goto skip;