From: Adam Dickmeiss Date: Thu, 13 Dec 2012 10:33:51 +0000 (+0100) Subject: CQL: Don't treat \^ as anchor X-Git-Tag: v4.2.48~14 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=f0a0db1db32d96c76ff331e28375ba5bae12b9d5 CQL: Don't treat \^ as anchor --- diff --git a/src/cqltransform.c b/src/cqltransform.c index ef93ca8..2b7c780 100644 --- a/src/cqltransform.c +++ b/src/cqltransform.c @@ -629,7 +629,8 @@ static void emit_term(cql_transform_t ct, if (process_term && length > 0) { - if (length > 1 && term[0] == '^' && term[length-1] == '^') + if (length > 1 && term[0] == '^' && term[length-1] == '^' && + term[length-2] != '\\') { cql_pr_attr(ct, "position", "firstAndLast", 0, pr, client_data, YAZ_SRW_ANCHORING_CHAR_IN_UNSUPP_POSITION); @@ -643,7 +644,8 @@ static void emit_term(cql_transform_t ct, term++; length--; } - else if (term[length-1] == '^') + else if (term[length-1] == '^' && + (length < 2 || term[length-2] != '\\')) { cql_pr_attr(ct, "position", "last", 0, pr, client_data, YAZ_SRW_ANCHORING_CHAR_IN_UNSUPP_POSITION);