SWORD25: Re-implement two LUA library I/O functions necessary for detecting and creating the config.lua configuration file
This commit is contained in:
parent
5fdf2796d6
commit
cbf7f740e4
2 changed files with 19 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue