Skip tokens starting with V(\" because they are already quoted

and should stay so.
This commit is contained in:
Holger Vogt 2021-11-03 20:37:27 +01:00
parent 80e56e4518
commit ac88c73c33
1 changed files with 4 additions and 2 deletions

View File

@ -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) */