parent
c3b379bf50
commit
72d2061ae2
@ -237,9 +237,10 @@ LJLIB_CF(os_time)
|
|||||||
ts.tm_mon = (int)((unsigned int)getfield(L, "month", -1) - 1u);
|
ts.tm_mon = (int)((unsigned int)getfield(L, "month", -1) - 1u);
|
||||||
ts.tm_year = (int)((unsigned int)getfield(L, "year", -1) - 1900u);
|
ts.tm_year = (int)((unsigned int)getfield(L, "year", -1) - 1900u);
|
||||||
ts.tm_isdst = getboolfield(L, "isdst");
|
ts.tm_isdst = getboolfield(L, "isdst");
|
||||||
|
errno = 0;
|
||||||
t = mktime(&ts);
|
t = mktime(&ts);
|
||||||
}
|
}
|
||||||
if (t == (time_t)(-1))
|
if (t == (time_t)(-1) && errno != 0)
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
else
|
else
|
||||||
lua_pushnumber(L, (lua_Number)t);
|
lua_pushnumber(L, (lua_Number)t);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user