static void add_email(int);
char *datafile = NULL;
-char *rcfile = NULL;
+static char *rcfile = NULL;
bool alternative_datafile = FALSE;
bool alternative_rcfile = FALSE;
fgetc(stdin);
}
- signal(SIGKILL, quit_abook_sig);
signal(SIGTERM, quit_abook_sig);
if(init_ui())
init_abook();
- get_commands();
+ get_commands();
quit_abook(QUIT_SAVE);
{
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 "
#ifdef DEBUG
fprintf(stderr, "cmd: %s\n", cmd);
#endif
- system(cmd);
+ system(cmd);
free(cmd);
/*
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;
init_add_email()
{
set_filenames();
- atexit(free_filenames);
check_abook_directory();
init_opts();
load_opts(rcfile);
return 0;
}
}
-
+
if(!quiet) {
FILE *in = fopen("/dev/tty", "r");
char c;