From: Raphaƫl Droz Date: Wed, 19 Dec 2012 01:53:05 +0000 (+0100) Subject: ldif: export all available emails for an entry X-Git-Tag: upstream/0.6.1~2^2~29 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=d9aefd47c40fb87a44acf7625b1599f72e066bce;p=pkg%2Fabook.git ldif: export all available emails for an entry All available emails are now part of the LDIF output in the form of multiple "email:" attributes. --- diff --git a/filter.c b/filter.c index 31b6f2d..c8b3d9e 100644 --- a/filter.c +++ b/filter.c @@ -998,6 +998,7 @@ static int ldif_export_database(FILE *out, struct db_enumerator e) { char email[MAX_EMAILSTR_LEN]; + abook_list *emails, *em; fprintf(out, "version: 1\n"); @@ -1018,10 +1019,15 @@ ldif_export_database(FILE *out, struct db_enumerator e) for(j = 0; j < ITEM_FIELDS; j++) { if(j == EMAIL) { - if(*email) // don't dump an empty email field - ldif_fput_type_and_value(out, - ldif_field_names[j], - email); + if(*email) { + tmp = db_email_get(e.item); + emails = csv_to_abook_list(tmp); + free(tmp); + for(em = emails; em; em = em->next) + ldif_fput_type_and_value(out, + ldif_field_names[EMAIL], + em->data); + } } else if(db_fget(e.item,j)) { ldif_fput_type_and_value(out,