]> git.deb.at Git - pkg/abook.git/blobdiff - abook.c
- code cleanups and minor fixes
[pkg/abook.git] / abook.c
diff --git a/abook.c b/abook.c
index 52b7f42d07329a6d5164e2a0b12f31b813c1b505..c754499260281e02a0dd4302797b2d10769b87fc 100644 (file)
--- a/abook.c
+++ b/abook.c
@@ -45,7 +45,7 @@ static void           convert(char *srcformat, char *srcfile,
 static void            add_email(int);
 
 char *datafile = NULL;
-char *rcfile = NULL;
+static char *rcfile = NULL;
 
 bool alternative_datafile = FALSE;
 bool alternative_rcfile = FALSE;
@@ -125,7 +125,6 @@ init_abook()
                fgetc(stdin);
        }
 
-       signal(SIGKILL, quit_abook_sig);
        signal(SIGTERM, quit_abook_sig);
 
        if(init_ui())
@@ -189,7 +188,7 @@ main(int argc, char **argv)
 
        init_abook();
 
-       get_commands(); 
+       get_commands();
 
        quit_abook(QUIT_SAVE);
 
@@ -394,7 +393,7 @@ show_usage()
 {
        puts    (PACKAGE " v " VERSION "\n");
        puts    ("     -h       --help                          show usage");
-       puts    ("     -C       --config        <file>          use an alternative configuration file");   
+       puts    ("     -C       --config        <file>          use an alternative configuration file");
        puts    ("      --datafile      <file>          use an alternative addressbook file");
        puts    ("      --mutt-query    <string>        make a query for mutt");
        puts    ("      --add-email                     "
@@ -555,7 +554,7 @@ launch_mutt(int item)
 #ifdef DEBUG
        fprintf(stderr, "cmd: %s\n", cmd);
 #endif
-       system(cmd);    
+       system(cmd);
        free(cmd);
 
        /*
@@ -592,12 +591,12 @@ launch_wwwbrowser(int item)
 
 FILE *
 abook_fopen (const char *path, const char *mode)
-{      
+{
        struct stat s;
        bool stat_ok;
 
        stat_ok = (stat(path, &s) != -1);
-       
+
        if(strchr(mode, 'r'))
                return (stat_ok && S_ISREG(s.st_mode)) ?
                        fopen(path, mode) : NULL;
@@ -692,7 +691,6 @@ static void
 init_add_email()
 {
        set_filenames();
-       atexit(free_filenames);
        check_abook_directory();
        init_opts();
        load_opts(rcfile);
@@ -722,7 +720,7 @@ add_email_add_item(int quiet, char *name, char *email)
                        return 0;
                }
        }
-                                       
+
        if(!quiet) {
                FILE *in = fopen("/dev/tty", "r");
                char c;