From: Adam Dickmeiss Date: Fri, 17 Apr 2015 12:05:37 +0000 (+0200) Subject: handle date range from a limit parameter PAZ-997 X-Git-Tag: v1.8.8~4 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=fade34917ec60c74d455c64d1e6d4f45dd289cc8;p=pazpar2-moved-to-github.git 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. --- 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 @@ - +