Invoke vars_init() before importing data with "-i"

We forgot to call vars_init() when importing an item using the "-i"
command line argument, which led to the pager configuration variable
being unset and hence the pager invocation (triggered to show the log in
case there are any errors during import) failing.

Fix this by calling vars_init() before io_import_data().

Reported-by: Andraž 'ruskie' Levstik <ruskie@codemages.net>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2011-07-28 12:45:29 +02:00
parent 34f094312f
commit 0c4e9d3f00

View File

@ -880,6 +880,8 @@ parse_args (int argc, char **argv, struct conf *conf)
{ {
io_check_file (path_apts, (int *)0); io_check_file (path_apts, (int *)0);
io_check_file (path_todo, (int *)0); io_check_file (path_todo, (int *)0);
/* Get default pager in case we need to show a log file. */
vars_init (conf);
io_load_app (); io_load_app ();
io_load_todo (); io_load_todo ();
io_import_data (IO_IMPORT_ICAL, conf, ifile); io_import_data (IO_IMPORT_ICAL, conf, ifile);