diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-08-15 15:05:52 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-08-15 20:21:34 +0200 |
commit | d64f0f343d2fcfe1d7768fa9acad83e34fa519f2 (patch) | |
tree | 904aee47cfb8543f5f09ca140367ab0e978df8e8 | |
parent | c94b507b92b3d833761f3e416d4d5bba709bf87f (diff) | |
download | apt-d64f0f343d2fcfe1d7768fa9acad83e34fa519f2.tar.gz |
patterns: Improve error reporting at end of argument list
-rw-r--r-- | apt-pkg/cachefilter-patterns.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apt-pkg/cachefilter-patterns.cc b/apt-pkg/cachefilter-patterns.cc index 986faaf52..1f448dae9 100644 --- a/apt-pkg/cachefilter-patterns.cc +++ b/apt-pkg/cachefilter-patterns.cc @@ -106,8 +106,10 @@ std::unique_ptr<PatternTreeParser::Node> PatternTreeParser::parsePattern() skipSpace(); } + node->end = state.offset; if (sentence[state.offset] != ')') - throw Error{*node, rstrprintf("Expected closing parenthesis, received %d", sentence[state.offset])}; + throw Error{node->arguments.empty() ? *node : *node->arguments[node->arguments.size() - 1], + rstrprintf("Expected closing parenthesis or comma after last argument, received %c", sentence[state.offset])}; node->end = ++state.offset; return node; |