From fade34917ec60c74d455c64d1e6d4f45dd289cc8 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 17 Apr 2015 14:05:37 +0200 Subject: [PATCH] handle date range from a limit parameter PAZ-997 The CCL term is not quoted unless it includes blanks. This will ensure that r=r is handled correctly. This changes behavior a bit. If term should not be converted to @and, then instead of r=r one should use r=o or r=3 instead. --- src/client.c | 8 +++++--- test/test_limit_limitmap_settings_2.xml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/client.c b/src/client.c index dac30f2..e40c8e1 100644 --- a/src/client.c +++ b/src/client.c @@ -1368,10 +1368,12 @@ static int apply_limit(struct session_database *sdb, struct ccl_rpn_node *cn; wrbuf_rewind(ccl_w); wrbuf_puts(ccl_w, ccl); - wrbuf_puts(ccl_w, "=\""); + wrbuf_putc(ccl_w, '='); + if (strchr(values[i], ' ')) + wrbuf_putc(ccl_w, '\"'); wrbuf_puts(ccl_w, values[i]); - wrbuf_puts(ccl_w, "\""); - + if (strchr(values[i], ' ')) + wrbuf_putc(ccl_w, '\"'); cn = ccl_find_str(ccl_map, wrbuf_cstr(ccl_w), &cerror, &cpos); if (cn) diff --git a/test/test_limit_limitmap_settings_2.xml b/test/test_limit_limitmap_settings_2.xml index 1eb610b..3bfd24e 100644 --- a/test/test_limit_limitmap_settings_2.xml +++ b/test/test_limit_limitmap_settings_2.xml @@ -23,7 +23,7 @@ - + -- 1.7.10.4