X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=abook.c;h=c754499260281e02a0dd4302797b2d10769b87fc;hb=1ce000762e496959ea5afa3830b171c73f0409c8;hp=24d9f52d1df53d32907cf95271057e0c1f07367f;hpb=8e2d9de658662d5cad666626ee507755519459d8;p=pkg%2Fabook.git diff --git a/abook.c b/abook.c index 24d9f52..c754499 100644 --- 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 use an alternative configuration file"); + puts (" -C --config use an alternative configuration file"); puts (" --datafile use an alternative addressbook file"); puts (" --mutt-query make a query for mutt"); puts (" --add-email " @@ -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;