- const char *best = 0;
- const char *current;
- char *whichp;
-
- for (whichp = "*?"; *whichp != '\0'; whichp++) {
- current = (const char *) memchr(term, *whichp, length);
- if (current != 0 && (best == 0 || current < best))
- best = current;
+ while (length > 0)
+ {
+ if (start || term[-1] != '\\')
+ if (strchr("*?", *term))
+ return term;
+ term++;
+ length--;
+ start = 0;
+ }
+ return 0;
+}
+
+
+/* ### checks for CQL relation-name rather than Type-1 attribute */
+static int has_modifier(struct cql_node *cn, const char *name) {
+ struct cql_node *mod;
+ for (mod = cn->u.st.modifiers; mod != 0; mod = mod->u.st.modifiers) {
+ if (!strcmp(mod->u.st.index, name))
+ return 1;