]> git.deb.at Git - pkg/abook.git/commitdiff
* don't unlink empty datafile, just truncate
authorJaakko Heinonen <jheinonen@users.sourceforge.net>
Thu, 24 Aug 2006 09:47:55 +0000 (09:47 +0000)
committerJaakko Heinonen <jheinonen@users.sourceforge.net>
Thu, 24 Aug 2006 09:47:55 +0000 (09:47 +0000)
* fix a comment typo

database.c
edit.c

index a9e77b55ad15f9d344d9bdae93e052896b50b88e..1b337c6b59f69bcc6687aa45b0000dfdfed5c6ad 100644 (file)
@@ -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 412b38562a285235925723bb78b06dcf464aa42b..c7a62e43751a38280ec4bbc3010138c6f2a7f1cd 100644 (file)
--- 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);