- 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) == (size_t) (cp - n->u.st.index) &&
- !memcmp(n->u.st.index, prefix, strlen(prefix)))
- {
- char *nval = xstrdup(cp+1);
- n->u.st.index_uri = xstrdup(uri);
- xfree (n->u.st.index);
- n->u.st.index = nval;
- }
- else if (!prefix && !cp)
- {
- n->u.st.index_uri = xstrdup(uri);
- }
- }
- if (!n->u.st.relation_uri && n->u.st.relation)
- {
- const char *cp = strchr(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);
- n->u.st.relation_uri = xstrdup(uri);
- xfree (n->u.st.relation);
- n->u.st.relation = nval;
- }
- }
+ 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) == (size_t) (cp - n->u.st.index) &&
+ !cql_strncmp(n->u.st.index, prefix, strlen(prefix)))
+ {
+ char *nval = nmem_strdup(nmem, cp+1);
+ n->u.st.index_uri = nmem_strdup(nmem, uri);
+ n->u.st.index = nval;
+ }
+ else if (!prefix && !cp)
+ {
+ n->u.st.index_uri = nmem_strdup(nmem, uri);
+ }
+ }
+ if (!n->u.st.relation_uri && n->u.st.relation)
+ {
+ const char *cp = strchr(n->u.st.relation, '.');
+ if (prefix && cp &&
+ strlen(prefix) == (size_t)(cp - n->u.st.relation) &&
+ !cql_strncmp(n->u.st.relation, prefix, strlen(prefix)))
+ {
+ char *nval = nmem_strdup(nmem, cp+1);
+ n->u.st.relation_uri = nmem_strdup(nmem, uri);
+ n->u.st.relation = nval;
+ }
+ }