summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-07-16 15:52:33 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-07-16 15:52:33 +0200
commitf7f49da17ca1352bd86b903d7bac448c3c5174e3 (patch)
tree95c67a77be82272010ae4a584da61be86ac425b4
parentbd784775aaa3c64c18c544b7aa6b6fffc6c01e8d (diff)
downloadcalcurse-f7f49da17ca1352bd86b903d7bac448c3c5174e3.zip
Initialize linked list for recurrent items
When switching to the generic linked list implementation for recurring events in 9fab248 (Use generic lists for recurring apointments and events., 2011-04-16), no initialization routine for the list of recurring events was added. Fix this and properly initialize the list on startup. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r--src/calcurse.c1
-rw-r--r--src/calcurse.h1
-rw-r--r--src/dmon.c1
-rw-r--r--src/recur.c5
4 files changed, 8 insertions, 0 deletions
diff --git a/src/calcurse.c b/src/calcurse.c
index b128dbd..389334d 100644
--- a/src/calcurse.c
+++ b/src/calcurse.c
@@ -518,6 +518,7 @@ int main(int argc, char **argv)
/* Initialize non-thread-safe data structures. */
event_llist_init();
+ recur_event_llist_init();
todo_init_list();
/*
diff --git a/src/calcurse.h b/src/calcurse.h
index 6112ede..16ca155 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -892,6 +892,7 @@ void recur_apoint_free_bkp(void);
void recur_event_free(struct recur_event *);
void recur_apoint_free(struct recur_apoint *);
void recur_apoint_llist_init(void);
+void recur_event_llist_init(void);
void recur_apoint_llist_free(void);
void recur_event_llist_free(void);
struct recur_apoint *recur_apoint_new(char *, char *, long, long, char,
diff --git a/src/dmon.c b/src/dmon.c
index 5653073..c51ee70 100644
--- a/src/dmon.c
+++ b/src/dmon.c
@@ -163,6 +163,7 @@ void dmon_start(int parent_exit_status)
apoint_llist_init();
recur_apoint_llist_init();
event_llist_init();
+ recur_event_llist_init();
todo_init_list();
io_load_app();
data_loaded = 1;
diff --git a/src/recur.c b/src/recur.c
index 801346d..69706b0 100644
--- a/src/recur.c
+++ b/src/recur.c
@@ -140,6 +140,11 @@ void recur_apoint_llist_init(void)
LLIST_TS_INIT(&recur_alist_p);
}
+void recur_event_llist_init(void)
+{
+ LLIST_INIT(&recur_elist);
+}
+
void recur_apoint_free(struct recur_apoint *rapt)
{
mem_free(rapt->mesg);