~vcs-imports/busybox/trunk

« back to all changes in this revision

Viewing changes to shell/ash.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:
12123
12123
                        if (args && app == &args->narg.next
12124
12124
                         && !vars && !redir
12125
12125
                        ) {
12126
 
                                struct builtincmd *bcmd;
12127
 
                                const char *name;
 
12126
//                              struct builtincmd *bcmd;
 
12127
//                              const char *name;
12128
12128
 
12129
12129
                                /* We have a function */
12130
12130
                                if (IF_BASH_FUNCTION(!function_flag &&) readtoken() != TRP)
12131
12131
                                        raise_error_unexpected_syntax(TRP);
12132
 
                                name = n->narg.text;
12133
 
                                if (!goodname(name)
12134
 
                                 || ((bcmd = find_builtin(name)) && IS_BUILTIN_SPECIAL(bcmd))
12135
 
                                ) {
12136
 
                                        raise_error_syntax("bad function name");
12137
 
                                }
 
12132
//bash allows functions named "123", "..", "return"!
 
12133
//                              name = n->narg.text;
 
12134
//                              if (!goodname(name)
 
12135
//                               || ((bcmd = find_builtin(name)) && IS_BUILTIN_SPECIAL(bcmd))
 
12136
//                              ) {
 
12137
//                                      raise_error_syntax("bad function name");
 
12138
//                              }
12138
12139
                                n->type = NDEFUN;
12139
12140
                                checkkwd = CHKNL | CHKKWD | CHKALIAS;
12140
12141
                                n->ndefun.text = n->narg.text;