diff options
author | Paul Gilbert | 2011-05-20 18:45:33 +1000 |
---|---|---|
committer | Paul Gilbert | 2011-05-20 18:45:33 +1000 |
commit | cbf7f740e4d61d3807308baf8af9adf8c6223ee6 (patch) | |
tree | b670de1d35d9ca04a78df522ef485d2b29d5965a /engines/sword25/util/lua/liolib.cpp | |
parent | 5fdf2796d6542db5ae05774bbbe792923c67b68b (diff) | |
download | scummvm-rg350-cbf7f740e4d61d3807308baf8af9adf8c6223ee6.tar.gz scummvm-rg350-cbf7f740e4d61d3807308baf8af9adf8c6223ee6.tar.bz2 scummvm-rg350-cbf7f740e4d61d3807308baf8af9adf8c6223ee6.zip |
SWORD25: Re-implement two LUA library I/O functions necessary for detecting and creating the config.lua configuration file
Diffstat (limited to 'engines/sword25/util/lua/liolib.cpp')
-rw-r--r-- | engines/sword25/util/lua/liolib.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/engines/sword25/util/lua/liolib.cpp b/engines/sword25/util/lua/liolib.cpp index f9bad30aed..aea6c328d8 100644 --- a/engines/sword25/util/lua/liolib.cpp +++ b/engines/sword25/util/lua/liolib.cpp @@ -27,7 +27,20 @@ static const char *const fnames[] = {"input", "output"}; static int pushresult (lua_State *L, int i, const char *filename) { - return luaL_error(L, "LUA file I/O functions have been removed in ScummVM"); + int en = 0; /*errno;*/ // Currently hardcoded for ScumMVM, this may need to be changed + if (i) { + lua_pushboolean(L, 1); + return 1; + } + else { + lua_pushnil(L); + if (filename) + lua_pushfstring(L, "%s: %s", filename, "General error" /*strerror(en)*/); + else + lua_pushfstring(L, "%s", "General error" /*strerror(en)*/); + lua_pushinteger(L, en); + return 3; + } } |