From eb8243743a777a8399deb78d990b0bb4b5cccad4 Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Tue, 26 Mar 2024 11:21:17 -0400 Subject: [PATCH] Prevent mishandling of SPECIAL COLOR reminders when pulling them from the queue. Bug reported by Damien Tardy-Panis. --- src/queue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/queue.c b/src/queue.c index 91b37401..461423f3 100644 --- a/src/queue.c +++ b/src/queue.c @@ -469,10 +469,12 @@ void HandleQueuedReminders(void) and trigtime() work correctly */ SaveAllTriggerInfo(&(q->t), &(q->tt), DSEToday, q->tt.ttime, 1); FileName = (char *) q->fname; + /* Make a COPY of q->t because TriggerReminder can change q->t.typ */ + Trigger tcopy = q->t; if (DaemonJSON) { DynamicBuffer out; DBufInit(&out); - (void) TriggerReminder(&p, &q->t, &q->tt, DSEToday, 1, &out); + (void) TriggerReminder(&p, &tcopy, &q->tt, DSEToday, 1, &out); if (q->typ != RUN_TYPE) { printf("\"body\":\""); chomp(&out); @@ -481,7 +483,7 @@ void HandleQueuedReminders(void) } DBufFree(&out); } else { - (void) TriggerReminder(&p, &q->t, &q->tt, DSEToday, 1, NULL); + (void) TriggerReminder(&p, &tcopy, &q->tt, DSEToday, 1, NULL); } FileName = NULL; if (IsServerMode() && !DaemonJSON && q->typ != RUN_TYPE) {