aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-12-13 21:31:29 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-12-13 21:31:29 +0100
commit89198a9e5d4e599a25a839c4d193f834bcd8c617 (patch)
tree60817eeb7654201417d13bff7f14cc624bcd7cb4
parentbbcecc4118416390571170868447fd2773a741bd (diff)
downloadbusybox-w32-89198a9e5d4e599a25a839c4d193f834bcd8c617.tar.gz
busybox-w32-89198a9e5d4e599a25a839c4d193f834bcd8c617.tar.bz2
busybox-w32-89198a9e5d4e599a25a839c4d193f834bcd8c617.zip
bc: simplify bc_lex_whitespace()
function old new delta bc_lex_whitespace 52 41 -11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--miscutils/bc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index a271a2040..5938e54ab 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -2790,9 +2790,13 @@ static void bc_lex_lineComment(BcLex *l)
2790 2790
2791static void bc_lex_whitespace(BcLex *l) 2791static void bc_lex_whitespace(BcLex *l)
2792{ 2792{
2793 char c;
2794 l->t.t = BC_LEX_WHITESPACE; 2793 l->t.t = BC_LEX_WHITESPACE;
2795 for (c = l->buf[l->i]; c != '\n' && isspace(c); c = l->buf[++l->i]); 2794 for (;;) {
2795 char c = l->buf[l->i];
2796 if (c == '\n' || !isspace(c))
2797 break;
2798 l->i++;
2799 }
2796} 2800}
2797 2801
2798static BC_STATUS zbc_lex_number(BcLex *l, char start) 2802static BC_STATUS zbc_lex_number(BcLex *l, char start)