diff options
author | Ron Yorston <rmy@pobox.com> | 2015-05-18 09:54:43 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-05-18 09:54:43 +0200 |
commit | 7e4ed267b645090fb576e1c876a88a9c73faabe9 (patch) | |
tree | 1afac46bd8d47a8262ca0f3bbd690383fcf77a3e /shell | |
parent | 3df47f9cbbb7f16608cbc642026625cdf7f06aa9 (diff) | |
download | busybox-w32-7e4ed267b645090fb576e1c876a88a9c73faabe9.tar.gz busybox-w32-7e4ed267b645090fb576e1c876a88a9c73faabe9.tar.bz2 busybox-w32-7e4ed267b645090fb576e1c876a88a9c73faabe9.zip |
ash: remove superfluous code in arithmetic mode
Based on commits 1a74845, cfc3d6a and ff13779 from
git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu
function old new delta
evalcommand 1197 1204 +7
localcmd 327 325 -2
readtoken1 3200 3180 -20
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 7/-22) Total: -15 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/shell/ash.c b/shell/ash.c index d87166c4f..ee7642a64 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -11282,9 +11282,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs) | |||
11282 | goto quotemark; | 11282 | goto quotemark; |
11283 | case CENDQUOTE: | 11283 | case CENDQUOTE: |
11284 | IF_ASH_BASH_COMPAT(bash_dollar_squote = 0;) | 11284 | IF_ASH_BASH_COMPAT(bash_dollar_squote = 0;) |
11285 | if (eofmark != NULL && arinest == 0 | 11285 | if (eofmark != NULL && varnest == 0) { |
11286 | && varnest == 0 | ||
11287 | ) { | ||
11288 | USTPUTC(c, out); | 11286 | USTPUTC(c, out); |
11289 | } else { | 11287 | } else { |
11290 | if (dqvarnest == 0) { | 11288 | if (dqvarnest == 0) { |
@@ -11320,7 +11318,6 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs) | |||
11320 | if (pgetc() == ')') { | 11318 | if (pgetc() == ')') { |
11321 | if (--arinest == 0) { | 11319 | if (--arinest == 0) { |
11322 | syntax = prevsyntax; | 11320 | syntax = prevsyntax; |
11323 | dblquote = (syntax == DQSYNTAX); | ||
11324 | c = CTLENDARI; | 11321 | c = CTLENDARI; |
11325 | } | 11322 | } |
11326 | } else { | 11323 | } else { |
@@ -11645,7 +11642,7 @@ parsesub: { | |||
11645 | ((unsigned char *)stackblock())[typeloc] = subtype | flags; | 11642 | ((unsigned char *)stackblock())[typeloc] = subtype | flags; |
11646 | if (subtype != VSNORMAL) { | 11643 | if (subtype != VSNORMAL) { |
11647 | varnest++; | 11644 | varnest++; |
11648 | if (dblquote || arinest) { | 11645 | if (dblquote) { |
11649 | dqvarnest++; | 11646 | dqvarnest++; |
11650 | } | 11647 | } |
11651 | } | 11648 | } |