1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

r10756: another fix for the construction of expressions from subtrees for

SUBSTRING searches. This time fix multi-part substring searches.
This commit is contained in:
Andrew Tridgell 2005-10-06 05:53:46 +00:00 committed by Gerald (Jerry) Carter
parent 71c06778d4
commit bf5cef6f00

View File

@ -695,16 +695,18 @@ char *ldb_filter_from_tree(void *mem_ctx, struct ldb_parse_tree *tree)
talloc_free(ret);
return NULL;
}
s = talloc_asprintf_append(ret, "%s*", s2);
if (tree->u.substring.chunks[i+1] ||
tree->u.substring.end_with_wildcard) {
s = talloc_asprintf_append(ret, "%s*", s2);
} else {
s = talloc_asprintf_append(ret, "%s", s2);
}
if (s == NULL) {
talloc_free(ret);
return NULL;
}
ret = s;
}
if ( ! tree->u.substring.end_with_wildcard ) {
ret[strlen(ret) - 1] = '\0'; /* remove last wildcard */
}
s = talloc_asprintf_append(ret, ")");
if (s == NULL) {
talloc_free(ret);