diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-12-10 23:27:13 +0300 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-12-10 23:27:13 +0300 |
commit | 46a14771078744751ffa2bdb840c1bb4b005241c (patch) | |
tree | 20835580439d93ce1bf95260b91b147e6e038cf7 /shell | |
parent | 11a802a0fa04627110809d908c588aa2c471d5aa (diff) |
ash: trivial optimization -6 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index 023294cbb..8d7c4ca75 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -4213,15 +4213,16 @@ cmdputs(const char *s) }; const char *p, *str; - char cc[2] = " "; + char cc[2]; char *nextc; unsigned char c; unsigned char subtype = 0; int quoted = 0; + cc[1] = '\0'; nextc = makestrspace((strlen(s) + 1) * 8, cmdnextc); p = s; - while ((c = *p++) != 0) { + while ((c = *p++) != '\0') { str = NULL; switch (c) { case CTLESC: @@ -4292,7 +4293,8 @@ cmdputs(const char *s) while ((c = *str++) != '\0') { USTPUTC(c, nextc); } - } + } /* while *p++ not NUL */ + if (quoted & 1) { USTPUTC('"', nextc); } |