From dad7bd83ff0af51cae48a41c242b05602b971d50 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sun, 28 Jul 2002 00:51:33 +0000 Subject: don't save empty strings. (pas_backend_summary_save): print out the errno 2002-07-27 Chris Toshok * backend/pas/pas-backend-summary.c (save_string): don't save empty strings. (pas_backend_summary_save): print out the errno when we fail. svn path=/trunk/; revision=17623 --- addressbook/ChangeLog | 6 ++++++ addressbook/backend/pas/pas-backend-summary.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 9ec7dfdb57..5255a627cb 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,9 @@ +2002-07-27 Chris Toshok + + * backend/pas/pas-backend-summary.c (save_string): don't save + empty strings. + (pas_backend_summary_save): print out the errno when we fail. + 2002-07-26 Ettore Perazzoli * gui/component/addressbook.c: Don't set up the ContactNew and diff --git a/addressbook/backend/pas/pas-backend-summary.c b/addressbook/backend/pas/pas-backend-summary.c index 55c9144ed3..a8ed8c05f9 100644 --- a/addressbook/backend/pas/pas-backend-summary.c +++ b/addressbook/backend/pas/pas-backend-summary.c @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -525,7 +526,7 @@ save_string (const char *str, FILE *fp) { int rv; - if (!str) + if (!str || !*str) return TRUE; rv = fwrite (str, strlen (str), 1, fp); @@ -624,7 +625,7 @@ pas_backend_summary_save (PASBackendSummary *summary) for (i = 0; i < summary->priv->items->len; i ++) { PASBackendSummaryItem *item = g_ptr_array_index (summary->priv->items, i); if (!pas_backend_summary_save_item (summary, fp, item)) { - g_warning ("failed to write an item to new summary file"); + g_warning ("failed to write an item to new summary file, errno = %d", errno); goto lose; } } -- cgit v1.2.3