summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-01-28 19:39:12 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-01-28 19:39:12 -0800
commit8746b638f0fe422dc7ba532c2b16d793438c0006 (patch)
tree4f3f1155fcc26f7b782b012269e4ae2d67dc7399 /match.c
parent5f23e30b998a7d2e42981c02ed6339c1e3659aa4 (diff)
downloadtxr-8746b638f0fe422dc7ba532c2b16d793438c0006.tar.gz
txr-8746b638f0fe422dc7ba532c2b16d793438c0006.tar.bz2
txr-8746b638f0fe422dc7ba532c2b16d793438c0006.zip
@(next): Diagnose source combined with source-giving option.
* match.c (v_next_impl): The check against the presence of multiple of source-specifying keyword options must also consider the base source as part of the mutual exclusion, so that syntax like @(next "file" :string "str") is also ruled out.
Diffstat (limited to 'match.c')
-rw-r--r--match.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/match.c b/match.c
index 5fce1696..972aae2b 100644
--- a/match.c
+++ b/match.c
@@ -2705,15 +2705,15 @@ static val v_next_impl(match_files_ctx *c)
sem_error(specline, lit("next: source required before keyword arguments"), nao);
{
- int count = (from_var != nil) +
+ int count = (source != nil) +
+ (from_var != nil) +
(list_expr != nil) +
(tlist_expr != nil) +
(string_expr != nil);
if (count > 1)
{
- sem_error(specline, lit("next: only one of :var, :list, :tlist or :string "
- "can be specified"), nao);
+ sem_error(specline, lit("next: at most one source may be specified"), nao);
}
}