From: Ivailo Monev Date: Tue, 7 Sep 2021 02:15:08 +0000 (+0300) Subject: use tm::tm_zone member for timezone if available X-Git-Tag: 4.12.0~1854 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=43da447d22e67892bee5e14706fb8ae0289744ff;p=kde%2FKatie.git use tm::tm_zone member for timezone if available for reference: https://www.openwall.com/lists/musl/2021/04/25/1 https://github.com/openbsd/src/blob/2207c4325726fdc5c4bcd0011af0fdf7d3dab137/lib/libc/time/Theory#L167 Signed-off-by: Ivailo Monev --- diff --git a/src/core/qcorecommon_p.h b/src/core/qcorecommon_p.h index 4fb0544c9..85c192740 100644 --- a/src/core/qcorecommon_p.h +++ b/src/core/qcorecommon_p.h @@ -56,7 +56,12 @@ static inline QString timeZone() #else struct tm *t = ::localtime(<ime); #endif // !QT_NO_THREAD + +#if defined(QT_HAVE_TM_TM_ZONE) + return QString::fromLocal8Bit(t->tm_zone); +#else return QString::fromLocal8Bit(tzname[t->tm_isdst]); +#endif } // Returns a human readable representation of the first \a len