From 993d188f1c29ed35869ee771fae3780e31ecab1d Mon Sep 17 00:00:00 2001 From: Stefan Schippers Date: Wed, 19 Aug 2020 09:06:11 +0200 Subject: [PATCH] subst_tok() compacted --- src/token.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/token.c b/src/token.c index 24525896..e12be7d8 100644 --- a/src/token.c +++ b/src/token.c @@ -852,12 +852,11 @@ char *subst_token(const char *s, const char *tok, const char *new_val) token[token_pos] = '\0'; token_pos = 0; matched_tok = !strcmp(token, tok) && !done_subst; + state=XENDTOK; if(c == '\0') { - state=XENDTOK; - s--; /* go to next iteration and process \0 as XENDTOK */ + s--; /* go to next iteration and process '\0' as XENDTOK */ continue; } - state=XENDTOK; } else if(state == XTOKEN && c=='=') { token[token_pos] = '\0'; token_pos = 0;