diff options
author | Denys Vlasenko | 2010-09-07 12:19:33 +0200 |
---|---|---|
committer | Denys Vlasenko | 2010-09-07 12:19:33 +0200 |
commit | 8b2f13d84def87b4ebd0901bf0c3157bc1f6dee3 (patch) | |
tree | 0bf072d3612c77dd8b0720973e46e8dbc37a040a /shell/hush.c | |
parent | 27c56f12670295286a881bbb87d506f0a5bfd40e (diff) | |
download | busybox-8b2f13d84def87b4ebd0901bf0c3157bc1f6dee3.zip busybox-8b2f13d84def87b4ebd0901bf0c3157bc1f6dee3.tar.gz |
shell: unify endofname() in hush and ash
function old new delta
builtin_umask 132 133 +1
changepath 195 194 -1
expand_and_evaluate_arith 77 69 -8
ash_arith 143 135 -8
expand_one_var 1551 1515 -36
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/4 up/down: 1/-53) Total: -52 bytes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/shell/hush.c b/shell/hush.c index ae2876a..3e8c387 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -1671,24 +1671,6 @@ static void unset_vars(char **strings) free(strings); } -#if ENABLE_SH_MATH_SUPPORT -# define is_name(c) ((c) == '_' || isalpha((unsigned char)(c))) -# define is_in_name(c) ((c) == '_' || isalnum((unsigned char)(c))) -static char* FAST_FUNC endofname(const char *name) -{ - char *p; - - p = (char *) name; - if (!is_name(*p)) - return p; - while (*++p) { - if (!is_in_name(*p)) - break; - } - return p; -} -#endif - static void FAST_FUNC set_local_var_from_halves(const char *name, const char *val) { char *var = xasprintf("%s=%s", name, val); @@ -4446,7 +4428,7 @@ static arith_t expand_and_evaluate_arith(const char *arg, int *errcode_p) hooks.lookupvar = get_local_var_value; hooks.setvar = set_local_var_from_halves; - hooks.endofname = endofname; + //hooks.endofname = endofname; exp_str = expand_pseudo_dquoted(arg); res = arith(exp_str ? exp_str : arg, errcode_p, &hooks); free(exp_str); |