History

Lua 5.1.3-rc1

Lua Team committed 18 years ago

Commit ea97e791 parent 4d388a360 files · +732 −439Browse files

Showing the changes to src/lua.c (1 of 60 files). Show all

Unified · Split

src/lua.c+4−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lua.c,v 1.160 2006/06/02 15:34:00 roberto Exp $
2+** $Id: lua.c,v 1.160.1.2 2007/12/28 15:32:23 roberto Exp $
33 ** Lua stand-alone interpreter
44 ** See Copyright Notice in lua.h
55 */
@@ -74,6 +74,8 @@ static int report (lua_State *L, int status) { · 68 unmodified lines
7474
7575
7676 static int traceback (lua_State *L) {
77+ if (!lua_isstring(L, 1)) /* 'message' not a string? */
78+ return 1; /* keep it intact */
7779 lua_getfield(L, LUA_GLOBALSINDEX, "debug");
7880 if (!lua_istable(L, -1)) {
7981 lua_pop(L, 1);
@@ -144,7 +146,7 @@ static int dostring (lua_State *L, const char *s, const char *name) { · 64 unmodified lines
144146 static int dolibrary (lua_State *L, const char *name) {
145147 lua_getglobal(L, "require");
146148 lua_pushstring(L, name);
147− return report(L, lua_pcall(L, 1, 0, 0));
149+ return report(L, docall(L, 1, 1));
148150 }
149151
150152