From ac88c73c3394d26fab0d09fafbd3726550064e33 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 3 Nov 2021 20:37:27 +0100 Subject: [PATCH] Skip tokens starting with V(\" because they are already quoted and should stay so. --- src/frontend/postcoms.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/postcoms.c b/src/frontend/postcoms.c index f53d7cb88..b092cd4d6 100644 --- a/src/frontend/postcoms.c +++ b/src/frontend/postcoms.c @@ -89,8 +89,10 @@ struct pnode* ft_getpnames_quotes(wordlist* wl, bool check) DS_CREATE(dsquote, 100); /* only the quoted strings*/ /* put double quotes around tokens which start with math or number chars */ while (*tmpstr != '\0') { - /*check if we have v(something) at the beginning after arithchar or space */ - if ((tmpstr[0] == 'v' || tmpstr[0] == 'V') && tmpstr[1] == '(' && (nsz == tmpstr || isspace_c(tmpstr[-1]) || is_arith_char(tmpstr[-1]) || tmpstr[-1] == '.')) { + /*check if we have v(something) at the beginning after arithchar or space, + skip V(" (already quoted) */ + if ((tmpstr[0] == 'v' || tmpstr[0] == 'V') && tmpstr[1] == '(' && !tmpstr[2] == '\"' && + (nsz == tmpstr || isspace_c(tmpstr[-1]) || is_arith_char(tmpstr[-1]) || tmpstr[-1] == '.')) { char* tmpstr2, * partoken2 = NULL; tmpstr += 2; /* get the complete zzz of v(zzz) */