Fix strftime-related functions on NetBSD. (#3579)

This commit is contained in:
Thomas Klausner authored and GitHub committed 2026-08-24 00:03:21 +09:00
1 parent fbee8f48ba
commit 17b411837d
1 file changed
+6
+6
View File
@@ -1853,7 +1853,13 @@ static jv f_strftime(jq_state *jq, jv a, jv b) {
* account ... */
tzset();
#endif
#ifdef __NetBSD__
timezone_t tz_utc = tzalloc("UTC");
size_t n = strftime_z(tz_utc, buf, max_size, fmt, &tm);
tzfree(tz_utc);
#else
size_t n = strftime(buf, max_size, fmt, &tm);
#endif
#if defined(__APPLE__) || defined(__sun)
if (tz) {
setenv("TZ", tz, 1);