ash: remove superfluous code in arithmetic mode
authorRon Yorston <rmy@pobox.com>
Mon, 18 May 2015 07:54:43 +0000 (09:54 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 18 May 2015 07:54:43 +0000 (09:54 +0200)
Based on commits 1a74845cfc3d6a 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>
shell/ash.c

index d87166c4f1286730fdfb210639b86a9c4d0e45d6..ee7642a645a2a0e02e8f836bc73255c8dcb11e01 100644 (file)
@@ -11282,9 +11282,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
                        goto quotemark;
                case CENDQUOTE:
                        IF_ASH_BASH_COMPAT(bash_dollar_squote = 0;)
-                       if (eofmark != NULL && arinest == 0
-                        && varnest == 0
-                       ) {
+                       if (eofmark != NULL && varnest == 0) {
                                USTPUTC(c, out);
                        } else {
                                if (dqvarnest == 0) {
@@ -11320,7 +11318,6 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
                                if (pgetc() == ')') {
                                        if (--arinest == 0) {
                                                syntax = prevsyntax;
-                                               dblquote = (syntax == DQSYNTAX);
                                                c = CTLENDARI;
                                        }
                                } else {
@@ -11645,7 +11642,7 @@ parsesub: {
                ((unsigned char *)stackblock())[typeloc] = subtype | flags;
                if (subtype != VSNORMAL) {
                        varnest++;
-                       if (dblquote || arinest) {
+                       if (dblquote) {
                                dqvarnest++;
                        }
                }