summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-08-15 15:05:52 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2019-08-15 20:21:34 +0200
commitd64f0f343d2fcfe1d7768fa9acad83e34fa519f2 (patch)
tree904aee47cfb8543f5f09ca140367ab0e978df8e8 /apt-pkg
parentc94b507b92b3d833761f3e416d4d5bba709bf87f (diff)
patterns: Improve error reporting at end of argument list
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/cachefilter-patterns.cc4
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;