From e436edb5c955d544296a9ca49ed79f4b1077deae Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Tue, 27 Jun 2023 06:07:07 +0200 Subject: [PATCH] Fix a couple of bugs in new quoting/comment handling --- src/string.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/string.c b/src/string.c index 425e8847..89cced1c 100644 --- a/src/string.c +++ b/src/string.c @@ -150,7 +150,7 @@ Estrtrim2(char *s) { int len, len2, ch, quote; - while (isspace(*s) == ' ') + while (isspace(*s)) s++; quote = '\0'; @@ -167,7 +167,10 @@ Estrtrim2(char *s) goto got_len; case '\'': case '"': - quote = (ch == quote) ? '\0' : ch; + if (!quote) + quote = ch; + else if (ch == quote) + quote = '\0'; break; case '#': if (quote)