Ignore whitespace indentation

Fixes #265
master
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++;
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 == '.'))
p++;
key = readbuf;
if (!isalpha((unsigned int)*key) && !isdigit((unsigned int)*p))
continue;
@ -89,7 +97,6 @@ pkgconf_parser_parse(FILE *f, void *data, const pkgconf_parser_operand_func_t *o
*p = '\0';
p--;
}
if (ops[(unsigned char) op])
ops[(unsigned char) op](data, lineno, key, value);
}