]> git.deb.at Git - pkg/abook.git/blobdiff - filter.c
ldif: Don't process the whole list of ldif fields, once one
[pkg/abook.git] / filter.c
index 13a02344a915195602db411b89b12d99ca77a9ad..ff3e511872f0e2bd3619680fa67c70de7699eff4 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -631,8 +631,8 @@ ldif_convert(ldif_item item, char *type, char *value)
        }
 
        for(i=0; i < LDIF_ITEM_FIELDS; i++) {
-               if(!safe_strcmp(ldif_field_names[i], type) && *value) {
-                       if(i == LDIF_ITEM_FIELDS - 1) /* this is a dirty hack */
+                if(!strcasecmp(ldif_field_names[i], type) && *value) {
+                        if(i == LDIF_ITEM_FIELDS - 1) /* this is a dirty hack */
                                if(safe_strcmp("person", value))
                                        break;
 
@@ -640,6 +640,7 @@ ldif_convert(ldif_item item, char *type, char *value)
                                free(item_fget(item, i));
 
                        item_fput(item, i, xstrdup(value));
+                       break;
                }
        }
 }