Update file.c

Made file.seek() return nil on error / EOF, as specified in documentation, instead of returning true.
This commit is contained in:
Ezekiel-DA 2015-02-25 14:34:07 -05:00
parent 9b3ea24198
commit c869eddb8a
1 changed files with 1 additions and 1 deletions

View File

@ -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;