From 383b885ff7654dc0171b5c1eaa449bb1e1cfe8f0 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 3 Aug 2015 13:46:25 +0100 Subject: ash: save a few bytes in code to parse case statements Based on commit 49b82fc from git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu. function old new delta parse_command 1563 1555 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8) Total: -8 bytes Signed-off-by: Ron Yorston Signed-off-by: Denys Vlasenko --- shell/ash.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shell/ash.c b/shell/ash.c index 3339666b9..18c7ff523 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -10959,10 +10959,8 @@ parse_command(void) /*n2->narg.next = NULL; - stzalloc did it */ n2->narg.text = wordtext; n2->narg.backquote = backquotelist; - do { - checkkwd = CHKKWD | CHKALIAS; - } while (readtoken() == TNL); - if (lasttoken != TIN) + checkkwd = CHKNL | CHKKWD | CHKALIAS; + if (readtoken() != TIN) raise_error_unexpected_syntax(TIN); cpp = &n1->ncase.cases; next_case: -- cgit v1.2.3