Ignore whitespace indentation
ci/woodpecker/push/woodpecker Pipeline was successful Details

Fixes #265
pull/249/head
Timo Röhling 2022-09-30 15:33:47 +02:00 committed by Ariadne Conill
parent be0d811942
commit 506ebab7d6
1 changed files with 9 additions and 2 deletions

View File

@ -44,10 +44,18 @@ pkgconf_parser_parse(FILE *f, void *data, const pkgconf_parser_operand_func_t *o
lineno++; lineno++;
p = readbuf; p = readbuf;
while (*p && isspace((unsigned int)*p))
p++;
if (*p && p != readbuf)
{
warnfunc(data, "%s:" SIZE_FMT_SPECIFIER ": warning: whitespace encountered while parsing key section\n",
filename, lineno);
warned_key_whitespace = true;
}
key = p;
while (*p && (isalpha((unsigned int)*p) || isdigit((unsigned int)*p) || *p == '_' || *p == '.')) while (*p && (isalpha((unsigned int)*p) || isdigit((unsigned int)*p) || *p == '_' || *p == '.'))
p++; p++;
key = readbuf;
if (!isalpha((unsigned int)*key) && !isdigit((unsigned int)*p)) if (!isalpha((unsigned int)*key) && !isdigit((unsigned int)*p))
continue; continue;
@ -89,7 +97,6 @@ pkgconf_parser_parse(FILE *f, void *data, const pkgconf_parser_operand_func_t *o
*p = '\0'; *p = '\0';
p--; p--;
} }
if (ops[(unsigned char) op]) if (ops[(unsigned char) op])
ops[(unsigned char) op](data, lineno, key, value); ops[(unsigned char) op](data, lineno, key, value);
} }