X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fcqltransform.c;h=aea8bdcb1d726763f1fc84728e73891dae27463d;hb=bb1db6aa43a5f6c15dfa645ff15fecd463795cf6;hp=b2422c9ee80989cd9ecd4d9f3ec6be809bcaadcf;hpb=1254f5913d639e30ac822165196170a9b53748ff;p=yaz-moved-to-github.git diff --git a/src/cqltransform.c b/src/cqltransform.c index b2422c9..aea8bdc 100644 --- a/src/cqltransform.c +++ b/src/cqltransform.c @@ -500,8 +500,7 @@ static int cql_pr_prox(cql_transform_t ct, struct cql_node *mods, void *client_data) { int exclusion = 0; - int distance; /* to be filled in later depending on unit */ - int distance_defined = 0; + int distance = -1; int ordered = 0; int proxrel = 2; /* less than or equal */ int unit = 2; /* word */ @@ -514,7 +513,6 @@ static int cql_pr_prox(cql_transform_t ct, struct cql_node *mods, if (!strcmp(name, "distance")) { distance = strtol(term, (char**) 0, 0); - distance_defined = 1; if (!strcmp(relation, "=")) proxrel = 3; else if (!strcmp(relation, ">")) @@ -564,7 +562,7 @@ static int cql_pr_prox(cql_transform_t ct, struct cql_node *mods, mods = mods->u.st.modifiers; } - if (!distance_defined) + if (distance == -1) distance = (unit == 2) ? 1 : 0; cql_pr_int(exclusion, pr, client_data);