|
@@ -284,7 +284,7 @@ LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) {
|
|
|
|
|
|
LUALIB_API int luaL_execresult (lua_State *L, int stat) {
|
|
LUALIB_API int luaL_execresult (lua_State *L, int stat) {
|
|
const char *what = "exit"; /* type of termination */
|
|
const char *what = "exit"; /* type of termination */
|
|
- if (stat == -1) /* error? */
|
|
|
|
|
|
+ if (stat != 0 && errno != 0) /* error with an 'errno'? */
|
|
return luaL_fileresult(L, 0, NULL);
|
|
return luaL_fileresult(L, 0, NULL);
|
|
else {
|
|
else {
|
|
l_inspectstat(stat, what); /* interpret result */
|
|
l_inspectstat(stat, what); /* interpret result */
|