X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fcqlutil.c;h=206132527d97e59b24b775fe965b0689f0d543ec;hp=d915c59a7a56fa64444fa8c4fe622713aed693f7;hb=f53079fadcadb1eeef45e1e6d254801d984d6068;hpb=00106dc85fcaa3b02f9a0d471ea90a594bf3a175 diff --git a/src/cqlutil.c b/src/cqlutil.c index d915c59..2061325 100644 --- a/src/cqlutil.c +++ b/src/cqlutil.c @@ -1,12 +1,17 @@ -/* $Id: cqlutil.c,v 1.3 2004-03-15 21:39:06 adam Exp $ +/* $Id: cqlutil.c,v 1.5 2004-10-03 22:34:07 adam Exp $ Copyright (C) 2002-2004 Index Data Aps This file is part of the YAZ toolkit. -See the file LICENSE. +See the file LICENSE for details. */ +/** + * \file cqlutil.c + * \brief Implements CQL tree node utilities. + */ + #include #include @@ -92,7 +97,8 @@ struct cql_node *cql_apply_prefix(struct cql_node *n, const char *prefix, if (!n->u.st.index_uri && n->u.st.index) { /* not yet resolved.. */ const char *cp = strchr(n->u.st.index, '.'); - if (prefix && cp && strlen(prefix) == cp - n->u.st.index && + if (prefix && cp && + strlen(prefix) == (size_t) (cp - n->u.st.index) && !memcmp(n->u.st.index, prefix, strlen(prefix))) { char *nval = xstrdup(cp+1); @@ -108,7 +114,8 @@ struct cql_node *cql_apply_prefix(struct cql_node *n, const char *prefix, if (!n->u.st.relation_uri && n->u.st.relation) { const char *cp = strchr(n->u.st.relation, '.'); - if (prefix && cp && strlen(prefix) == cp - n->u.st.relation && + if (prefix && cp && + strlen(prefix) == (size_t)(cp - n->u.st.relation) && !memcmp(n->u.st.relation, prefix, strlen(prefix))) { char *nval = xstrdup(cp+1);