* src/merge-evolution.c: (gl_merge_evolution_get_record):
* src/merge-vcard.c: (gl_merge_vcard_get_record),
(parse_next_vcard):
Additional cleanup of EDS and vcard backends. Provided by
Austin Henry <ahenry@users.sourceforge.net>.
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@558
f5e0f49d-192f-0410-a22d-
a8d8700d0965
+2005-10-27 Jim Evins <evins@snaught.com>
+
+ * src/merge-evolution.c: (gl_merge_evolution_get_record):
+ * src/merge-vcard.c: (gl_merge_vcard_get_record),
+ (parse_next_vcard):
+ Additional cleanup of EDS and vcard backends. Provided by
+ Austin Henry <ahenry@users.sourceforge.net>.
+
2005-10-24 Jim Evins <evins@snaught.com>
* AUTHORS:
/* get the record key */
field = g_new0 (glMergeField, 1);
field->key = g_strdup ("record_key");
- field->value = g_strdup (e_contact_get(contact, E_CONTACT_FILE_AS));
+ field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_FILE_AS));
record->field_list = g_list_append (record->field_list, field);
/* get the full name */
field = g_new0 (glMergeField, 1);
field->key = g_strdup ("full_name");
- field->value = g_strdup (e_contact_get(contact, E_CONTACT_FULL_NAME));
+ field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_FULL_NAME));
record->field_list = g_list_append (record->field_list, field);
/* get the home address */
field = g_new0 (glMergeField, 1);
field->key = g_strdup ("home_address");
- field->value = g_strdup (e_contact_get(contact, E_CONTACT_ADDRESS_LABEL_HOME));
+ field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_ADDRESS_LABEL_HOME));
record->field_list = g_list_append (record->field_list, field);
/* get the work address */
field = g_new0 (glMergeField, 1);
field->key = g_strdup ("work_address");
- field->value = g_strdup (e_contact_get(contact, E_CONTACT_ADDRESS_LABEL_WORK));
+ field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_ADDRESS_LABEL_WORK));
record->field_list = g_list_append (record->field_list, field);
merge_vcard = GL_MERGE_VCARD (merge);
vcard = parse_next_vcard(merge_vcard->private->fp);
- if (vcard[0] == '\0') {
+ if (vcard == NULL || vcard[0] == '\0') {
return NULL; /* EOF */
}
contact = e_contact_new_from_vcard(vcard);
/* get the full name */
field = g_new0 (glMergeField, 1);
field->key = g_strdup ("full_name");
- field->value = g_strdup (e_contact_get(contact, E_CONTACT_FULL_NAME));
+ field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_FULL_NAME));
record->field_list = g_list_append (record->field_list, field);
/* get the home address */
field = g_new0 (glMergeField, 1);
field->key = g_strdup ("home_address");
- field->value = g_strdup (e_contact_get(contact, E_CONTACT_ADDRESS_LABEL_HOME));
+ field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_ADDRESS_LABEL_HOME));
record->field_list = g_list_append (record->field_list, field);
/* get the work address */
field = g_new0 (glMergeField, 1);
field->key = g_strdup ("work_address");
- field->value = g_strdup (e_contact_get(contact, E_CONTACT_ADDRESS_LABEL_WORK));
+ field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_ADDRESS_LABEL_WORK));
record->field_list = g_list_append (record->field_list, field);
char line[512];
int size = 2048, cursize = 0;
+ /* if no source has been set up, don't try to read from the file */
+ if (!fp) {
+ return NULL;
+ }
+
vcard = g_malloc0(size);
while (fgets(line, sizeof(line), fp) && found_end == FALSE) {