subst_tok() compacted

This commit is contained in:
Stefan Schippers 2020-08-19 09:06:11 +02:00
parent edca38f942
commit 993d188f1c
1 changed files with 2 additions and 3 deletions

View File

@ -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;