summaryrefslogtreecommitdiff
path: root/loslib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-12-17 14:46:37 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-12-17 14:46:37 -0200
commit063d4e4543088e7a21965bda8ee5a0f952a9029e (patch)
tree6c3f2f8e98c26f071a94a32f9f2754396a66a9de /loslib.c
parente354c6355e7f48e087678ec49e340ca0696725b1 (diff)
downloadlua-5.3.5.tar.gz
lua-5.3.5.tar.bz2
lua-5.3.5.zip
Lua 5.3.5 ported to gitv5.3.5
This is the first commit for the branch Lua 5.3. All source files were copied from the official distribution of 5.3.5 in the Lua site. The test files are the same of 5.3.4. The manual came from the previous RCS repository, revision 1.167.1.2.
Diffstat (limited to '')
-rw-r--r--loslib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/loslib.c b/loslib.c
index dd2bb378..de590c6b 100644
--- a/loslib.c
+++ b/loslib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: loslib.c,v 1.64 2016/04/18 13:06:55 roberto Exp $ 2** $Id: loslib.c,v 1.65.1.1 2017/04/19 17:29:57 roberto Exp $
3** Standard Operating System library 3** Standard Operating System library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -293,7 +293,8 @@ static int os_date (lua_State *L) {
293 else 293 else
294 stm = l_localtime(&t, &tmr); 294 stm = l_localtime(&t, &tmr);
295 if (stm == NULL) /* invalid date? */ 295 if (stm == NULL) /* invalid date? */
296 luaL_error(L, "time result cannot be represented in this installation"); 296 return luaL_error(L,
297 "time result cannot be represented in this installation");
297 if (strcmp(s, "*t") == 0) { 298 if (strcmp(s, "*t") == 0) {
298 lua_createtable(L, 0, 9); /* 9 = number of fields */ 299 lua_createtable(L, 0, 9); /* 9 = number of fields */
299 setallfields(L, stm); 300 setallfields(L, stm);
@@ -340,7 +341,8 @@ static int os_time (lua_State *L) {
340 setallfields(L, &ts); /* update fields with normalized values */ 341 setallfields(L, &ts); /* update fields with normalized values */
341 } 342 }
342 if (t != (time_t)(l_timet)t || t == (time_t)(-1)) 343 if (t != (time_t)(l_timet)t || t == (time_t)(-1))
343 luaL_error(L, "time result cannot be represented in this installation"); 344 return luaL_error(L,
345 "time result cannot be represented in this installation");
344 l_pushtime(L, t); 346 l_pushtime(L, t);
345 return 1; 347 return 1;
346} 348}