diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2023-06-17 21:02:37 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2023-06-17 21:13:13 +0200 |
commit | 96769486e20fd5f1142cae0db2cbacef31dc75e9 (patch) | |
tree | f40b504f812eda9787084aaaf377fe1a144466d0 /shell/ash.c | |
parent | d0441222db80c6fc0c47fa014106d38e25bfada7 (diff) | |
download | busybox-w32-96769486e20fd5f1142cae0db2cbacef31dc75e9.tar.gz busybox-w32-96769486e20fd5f1142cae0db2cbacef31dc75e9.tar.bz2 busybox-w32-96769486e20fd5f1142cae0db2cbacef31dc75e9.zip |
shell: move varcmp() to shell_common.h and use it in hush
function old new delta
unset_local_var - 112 +112
findvar 31 35 +4
set_vars_and_save_old 144 141 -3
helper_export_local 235 230 -5
set_local_var 425 416 -9
handle_changed_special_names 38 27 -11
builtin_unset 154 141 -13
builtin_getopts 404 391 -13
get_local_var_value 281 260 -21
get_ptr_to_local_var 71 45 -26
unset_local_var_len 139 - -139
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/8 up/down: 116/-240) Total: -124 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/shell/ash.c b/shell/ash.c index dde36dd7c..96d2433d3 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -2260,30 +2260,6 @@ getoptsreset(const char *value) | |||
2260 | #endif | 2260 | #endif |
2261 | 2261 | ||
2262 | /* | 2262 | /* |
2263 | * Compares two strings up to the first = or '\0'. The first | ||
2264 | * string must be terminated by '='; the second may be terminated by | ||
2265 | * either '=' or '\0'. | ||
2266 | */ | ||
2267 | static int | ||
2268 | varcmp(const char *p, const char *q) | ||
2269 | { | ||
2270 | int c, d; | ||
2271 | |||
2272 | while ((c = *p) == (d = *q)) { | ||
2273 | if (c == '\0' || c == '=') | ||
2274 | goto out; | ||
2275 | p++; | ||
2276 | q++; | ||
2277 | } | ||
2278 | if (c == '=') | ||
2279 | c = '\0'; | ||
2280 | if (d == '=') | ||
2281 | d = '\0'; | ||
2282 | out: | ||
2283 | return c - d; | ||
2284 | } | ||
2285 | |||
2286 | /* | ||
2287 | * Find the appropriate entry in the hash table from the name. | 2263 | * Find the appropriate entry in the hash table from the name. |
2288 | */ | 2264 | */ |
2289 | static struct var ** | 2265 | static struct var ** |