Fix strftime-related functions on NetBSD. (#3579)
This commit is contained in:
1 parent
fbee8f48ba
commit
17b411837d
1 file changed
+6
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user