From: Jaakko Heinonen Date: Thu, 24 Aug 2006 09:47:55 +0000 (+0000) Subject: * don't unlink empty datafile, just truncate X-Git-Tag: upstream/0.6.1~2^2~105 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=0541360161a8512d9852c5381ad0ac9953956edd;p=pkg%2Fabook.git * don't unlink empty datafile, just truncate * fix a comment typo --- diff --git a/database.c b/database.c index a9e77b5..1b337c6 100644 --- a/database.c +++ b/database.c @@ -358,18 +358,13 @@ save_database() goto out; } - if(list_is_empty()) { - fclose(out); - unlink(datafile); - ret = 1; - goto out; - } + if(!list_is_empty()) + /* + * Possibly should check if write_database failed. + * Currently it returns always zero. + */ + write_database(out, e); - /* - * Possibly should check if write_database failed. - * Currently it returns always zero. - */ - write_database(out, e); fclose(out); if(access(datafile, F_OK) == 0 && diff --git a/edit.c b/edit.c index 412b385..c7a62e4 100644 --- a/edit.c +++ b/edit.c @@ -361,7 +361,7 @@ edit_list(int item, int nb, int isemail) &field, MAX_EMAIL_LEN)) return; /* user cancelled ( C-g ) */ - /* TODO if list item contains commas, sjould use quotes instead */ + /* TODO if list item contains commas, should use quotes instead */ if(field) fix_email_str(field);