From ddc3fda5f1ecc9cb7adeb616df820d9e629ac5b2 Mon Sep 17 00:00:00 2001
From: Lars Henriksen <LarsHenriksen@get2net.dk>
Date: Wed, 15 Aug 2018 21:14:26 +0200
Subject: Initialize variables in non-interactive mode in all cases

The changed handling of thread ids implies that they must be initialized
before exit of calcurse where they are used. Hence the function
vars_init() is now called irrespective of command line arguments.

Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
---
 src/args.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

(limited to 'src')

diff --git a/src/args.c b/src/args.c
index bd4fb73..60de7da 100644
--- a/src/args.c
+++ b/src/args.c
@@ -730,13 +730,13 @@ int parse_args(int argc, char **argv)
 	io_check_dir(path_dir);
 	io_check_dir(path_notes);
 
+	vars_init();
 	if (status) {
 		status_arg();
 	} else if (grep) {
 		io_check_file(path_apts);
 		io_check_file(path_todo);
 		io_check_file(path_conf);
-		vars_init();
 		config_load();	/* To get output date format. */
 		io_load_data(&filter);
 		if (grep_filter) {
@@ -759,7 +759,6 @@ int parse_args(int argc, char **argv)
 		io_check_file(path_apts);
 		io_check_file(path_todo);
 		io_check_file(path_conf);
-		vars_init();
 		config_load();	/* To get output date format. */
 		io_load_data(&filter);
 
@@ -786,7 +785,6 @@ int parse_args(int argc, char **argv)
 		io_check_file(path_apts);
 		io_check_file(path_todo);
 		/* Get default pager in case we need to show a log file. */
-		vars_init();
 		io_load_data(NULL);
 		if (dump_imported) {
 			/*
-- 
cgit v1.2.3-70-g09d2