X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fcqlutil.c;h=ba477de410a000f1e07f8544bc2e4ef00fcca0ee;hp=43e499b2f3cf8a88cbe8f480cfa1e590412c85c1;hb=176adcd5ec7f2340fb6f0f625a727498db9c04c4;hpb=7dfff1f7b79d8a3cf5f5ed62c71f6e4c2a616072 diff --git a/src/cqlutil.c b/src/cqlutil.c index 43e499b..ba477de 100644 --- a/src/cqlutil.c +++ b/src/cqlutil.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2011 Index Data + * Copyright (C) 1995-2013 Index Data * See the file LICENSE for details. */ /** @@ -34,7 +34,7 @@ struct cql_node *cql_node_dup(NMEM nmem, struct cql_node *cp) cp->u.st.relation, cp->u.st.term); cn->u.st.modifiers = cql_node_dup(nmem, cp->u.st.modifiers); - cn->u.st.index_uri = cp->u.st.index_uri ? + cn->u.st.index_uri = cp->u.st.index_uri ? nmem_strdup(nmem, cp->u.st.index_uri) : 0; cn->u.st.relation_uri = cp->u.st.relation_uri ? nmem_strdup(nmem, cp->u.st.relation_uri) : 0; @@ -98,6 +98,7 @@ struct cql_node *cql_node_mk_sort(NMEM nmem, const char *index, p->u.sort.index = nmem_strdup(nmem, index); p->u.sort.modifiers = modifiers; p->u.sort.next = 0; + p->u.sort.search = 0; return p; } @@ -115,7 +116,7 @@ struct cql_node *cql_apply_prefix(NMEM nmem, if (!n->u.st.index_uri && n->u.st.index) { /* not yet resolved.. */ const char *cp = strchr(n->u.st.index, '.'); - if (prefix && cp && + if (prefix && cp && strlen(prefix) == (size_t) (cp - n->u.st.index) && !cql_strncmp(n->u.st.index, prefix, strlen(prefix))) {