From d64f0f343d2fcfe1d7768fa9acad83e34fa519f2 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 15 Aug 2019 15:05:52 +0200 Subject: patterns: Improve error reporting at end of argument list --- apt-pkg/cachefilter-patterns.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apt-pkg/cachefilter-patterns.cc') 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::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; -- cgit v1.2.3-70-g09d2