- term++;
- length -= 2;
- }
- else if (first_wc == term && second_wc == 0 && *first_wc == '*'
- && cql_pr_attr(ct, "truncation", "left", 0,
- pr, client_data, 0))
- {
- term++;
- length--;
- }
- else if (first_wc == term + length-1 && second_wc == 0
- && *first_wc == '*'
- && cql_pr_attr(ct, "truncation", "right", 0,
- pr, client_data, 0))
- {
- length--;
- }
- else if (first_wc)
- {
- /* We have one or more wildcard characters, but not in a
- * way that can be dealt with using only the standard
- * left-, right- and both-truncation attributes. We need
- * to translate the pattern into a Z39.58-type pattern,
- * which has been supported in BIB-1 since 1996. If
- * there's no configuration element for "truncation.z3958"
- * we indicate this as error 28 "Masking character not
- * supported".
- */
- int i;
- cql_pr_attr(ct, "truncation", "z3958", 0,
- pr, client_data, YAZ_SRW_MASKING_CHAR_UNSUPP);
- z3958_mem = (char *) xmalloc(length+1);
- for (i = 0; i < length; i++)
+ if (trunc == 3 && cql_pr_attr(ct, "truncation",
+ "both", 0, pr, client_data, 0))