mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Prevent infinite test loop.
This commit is contained in:
@@ -1125,6 +1125,12 @@ ProcessLongOption(char const *arg)
|
||||
if (!strcmp(arg, "test")) {
|
||||
fprintf(stderr, "Enabling test mode: This is meant for the acceptance test.\nDo not use --test in production.\n");
|
||||
TestMode = 1;
|
||||
|
||||
/* Update RealToday because of TestMode */
|
||||
RealToday = SystemDate(&CurYear, &CurMon, &CurDay);
|
||||
DSEToday = RealToday;
|
||||
FromDSE(DSEToday, &CurYear, &CurMon, &CurDay);
|
||||
|
||||
return;
|
||||
}
|
||||
if (!strcmp(arg, "version")) {
|
||||
|
||||
@@ -1050,6 +1050,9 @@ int SystemDate(int *y, int *m, int *d)
|
||||
|
||||
/* In test mode, always return 6 January 2025 */
|
||||
if (TestMode) {
|
||||
*y = 2025;
|
||||
*m = 0;
|
||||
*d = 6;
|
||||
return 12803; /* 2025-01-06 */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user