#include "xmalloc.h"
#include <assert.h>
+#ifdef HAVE_VFORMAT
+#include "vcard.h"
+#endif
+
extern abook_field_list *fields_list;
extern int fields_count;
if(i < 0)
return -1;
+#ifdef HAVE_VFORMAT
+ // this is a special case for
+ // libvformat whose API expects a filename
+ if(!strcmp(filtname, "vcard")) {
+ if(!strcmp(filename, "-"))
+ ret = vcard_parse_file_libvformat("/dev/stdin");
+ else
+ ret = vcard_parse_file_libvformat(filename);
+ }
+ else
+#endif
+
if(!strcmp(filename, "-")) {
struct stat s;
if((fstat(fileno(stdin), &s)) == -1 || S_ISDIR(s.st_mode))
}
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;
free(item_fget(item, i));
item_fput(item, i, xstrdup(value));
+ break;
}
}
}