summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Röhling <roehling@debian.org>2022-09-30 15:33:47 +0200
committerAndrej Shadura <andrewsh@debian.org>2022-10-02 13:15:07 +0200
commit8f1855cc44c482595931a65ea306d4e8cda940fc (patch)
tree8b6fc6548761fccc1056a13b5aab8a86d8b799b3
parent4f5a911de9478b34d1362d3fd7a4f4f7c2a38942 (diff)
Ignore whitespace indentationarchive/debian/1.8.0-7
Bug: https://github.com/pkgconf/pkgconf/issues/265 Bug-Debian: https://bugs.debian.org/1016922 Gbp-Pq: Name ignore-whitespace-indentation.patch
-rw-r--r--libpkgconf/parser.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libpkgconf/parser.c b/libpkgconf/parser.c
index 7ac9362..da376c6 100644
--- a/libpkgconf/parser.c
+++ b/libpkgconf/parser.c
@@ -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);
}