Update file.c
Made file.seek() return nil on error / EOF, as specified in documentation, instead of returning true.
This commit is contained in:
parent
9b3ea24198
commit
c869eddb8a
|
@ -111,7 +111,7 @@ static int file_seek (lua_State *L)
|
|||
long offset = luaL_optlong(L, 2, 0);
|
||||
op = fs_seek(file_fd, offset, mode[op]);
|
||||
if (op)
|
||||
lua_pushboolean(L, 1); /* error */
|
||||
lua_pushnil(L); /* error */
|
||||
else
|
||||
lua_pushinteger(L, fs_tell(file_fd));
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue