diff options
-rw-r--r-- | lua.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.91 2002/06/18 17:12:05 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.92 2002/06/18 17:43:49 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -73,9 +73,14 @@ static void report (int status) { | |||
73 | lua_remove(L, -2); /* lease only traceback on stack */ | 73 | lua_remove(L, -2); /* lease only traceback on stack */ |
74 | } | 74 | } |
75 | lua_getglobal(L, "_ALERT"); | 75 | lua_getglobal(L, "_ALERT"); |
76 | lua_pushvalue(L, -2); | 76 | if (lua_isfunction(L, -1)) { |
77 | lua_pcall(L, 1, 0); | 77 | lua_pushvalue(L, -2); |
78 | lua_pop(L, 1); | 78 | lua_pcall(L, 1, 0); |
79 | } | ||
80 | else { | ||
81 | lua_pop(L, 1); | ||
82 | fprintf(stderr, "%s", lua_tostring(L, -1)); | ||
83 | } | ||
79 | } | 84 | } |
80 | } | 85 | } |
81 | 86 | ||