2008-06-16 17:41:49 +00:00
|
|
|
diff -up evolution-data-server-2.23.4/addressbook/backends/ldap/e-book-backend-ldap.c.fix-ldap-query evolution-data-server-2.23.4/addressbook/backends/ldap/e-book-backend-ldap.c
|
|
|
|
--- evolution-data-server-2.23.4/addressbook/backends/ldap/e-book-backend-ldap.c.fix-ldap-query 2008-06-15 23:18:08.000000000 -0400
|
|
|
|
+++ evolution-data-server-2.23.4/addressbook/backends/ldap/e-book-backend-ldap.c 2008-06-16 10:34:29.000000000 -0400
|
|
|
|
@@ -3417,22 +3417,28 @@ func_and(struct _ESExp *f, int argc, str
|
2007-10-19 16:59:47 +00:00
|
|
|
char ** strings;
|
|
|
|
|
|
|
|
if (argc > 0) {
|
|
|
|
- int i;
|
|
|
|
+ int i, empty;
|
|
|
|
|
|
|
|
strings = g_new0(char*, argc+3);
|
|
|
|
strings[0] = g_strdup ("(&");
|
|
|
|
strings[argc+3 - 2] = g_strdup (")");
|
2007-12-03 23:05:27 +00:00
|
|
|
|
2007-10-19 16:59:47 +00:00
|
|
|
+ empty = 0;
|
|
|
|
for (i = 0; i < argc; i ++) {
|
|
|
|
GList *list_head = ldap_data->list;
|
|
|
|
if (!list_head)
|
|
|
|
break;
|
|
|
|
+ if (strlen (list_head->data) == 0)
|
|
|
|
+ empty++;
|
|
|
|
strings[argc - i] = list_head->data;
|
|
|
|
ldap_data->list = g_list_remove_link(list_head, list_head);
|
|
|
|
g_list_free_1(list_head);
|
|
|
|
}
|
|
|
|
|
|
|
|
- ldap_data->list = g_list_prepend(ldap_data->list, g_strjoinv(" ", strings));
|
|
|
|
+ if (empty == argc)
|
|
|
|
+ ldap_data->list = g_list_prepend(ldap_data->list, g_strdup(" "));
|
|
|
|
+ else
|
|
|
|
+ ldap_data->list = g_list_prepend(ldap_data->list, g_strjoinv(" ", strings));
|
|
|
|
|
|
|
|
for (i = 0 ; i < argc + 2; i ++)
|
|
|
|
g_free (strings[i]);
|
2008-06-16 17:41:49 +00:00
|
|
|
@@ -3454,22 +3460,28 @@ func_or(struct _ESExp *f, int argc, stru
|
2007-10-19 16:59:47 +00:00
|
|
|
char ** strings;
|
|
|
|
|
|
|
|
if (argc > 0) {
|
|
|
|
- int i;
|
|
|
|
+ int i, empty;
|
|
|
|
|
|
|
|
strings = g_new0(char*, argc+3);
|
|
|
|
strings[0] = g_strdup ("(|");
|
|
|
|
strings[argc+3 - 2] = g_strdup (")");
|
|
|
|
|
|
|
|
+ empty = 0;
|
|
|
|
for (i = 0; i < argc; i ++) {
|
|
|
|
GList *list_head = ldap_data->list;
|
|
|
|
if (!list_head)
|
|
|
|
break;
|
|
|
|
+ if (strlen (list_head->data) == 0)
|
|
|
|
+ empty++;
|
|
|
|
strings[argc - i] = list_head->data;
|
|
|
|
ldap_data->list = g_list_remove_link(list_head, list_head);
|
|
|
|
g_list_free_1(list_head);
|
|
|
|
}
|
|
|
|
|
|
|
|
- ldap_data->list = g_list_prepend(ldap_data->list, g_strjoinv(" ", strings));
|
|
|
|
+ if (empty == argc)
|
|
|
|
+ ldap_data->list = g_list_prepend(ldap_data->list, g_strdup(" "));
|
|
|
|
+ else
|
|
|
|
+ ldap_data->list = g_list_prepend(ldap_data->list, g_strjoinv(" ", strings));
|
|
|
|
|
|
|
|
for (i = 0 ; i < argc + 2; i ++)
|
|
|
|
g_free (strings[i]);
|
2008-06-16 17:41:49 +00:00
|
|
|
@@ -3622,6 +3634,7 @@ func_beginswith(struct _ESExp *f, int ar
|
2007-10-19 16:59:47 +00:00
|
|
|
if (strlen (str) == 0) {
|
2008-06-16 17:41:49 +00:00
|
|
|
g_free (str);
|
|
|
|
|
|
|
|
+ ldap_data->list = g_list_prepend (ldap_data->list, g_strdup (""));
|
2007-10-19 16:59:47 +00:00
|
|
|
r = e_sexp_result_new (f, ESEXP_RES_BOOL);
|
|
|
|
r->value.bool = FALSE;
|
|
|
|
return r;
|