Fix changelog parsing affecting caller timezone state

We meddle with TZ environ which then propagates to other values through
mktime() implicitly calling tzset(), but that other data doesn't get
reset by just restoring the TZ variable. Restore initial state by explicitly
call tzset() after we're done with it.

Fixes: #1821
This commit is contained in:
Panu Matilainen 2022-05-30 14:24:45 +03:00
parent b34333fa02
commit 1a7de551a7
1 changed files with 1 additions and 0 deletions

View File

@ -175,6 +175,7 @@ static int dateToTimet(const char * datestr, time_t * secs, int * date_words)
setenv("TZ", tz, 1); setenv("TZ", tz, 1);
free(tz); free(tz);
} }
tzset();
if (*secs == -1) goto exit; if (*secs == -1) goto exit;