Merge branch 'master' into v2.1

This commit is contained in:
Mike Pall 2026-06-13 11:00:59 +02:00
commit 194d7f2d63

View File

@ -243,9 +243,10 @@ LJLIB_CF(os_time)
ts.tm_mon = (int)((unsigned int)getfield(L, "month", -1) - 1u);
ts.tm_year = (int)((unsigned int)getfield(L, "year", -1) - 1900u);
ts.tm_isdst = getboolfield(L, "isdst");
errno = 0;
t = mktime(&ts);
}
if (t == (time_t)(-1))
if (t == (time_t)(-1) && errno != 0)
lua_pushnil(L);
else
lua_pushnumber(L, (lua_Number)t);