no more newlines at the end of error messages

This commit is contained in:
Roberto Ierusalimschy
2002-09-05 16:45:42 -03:00
parent b2bc3b44b6
commit 1bdde38bd2
6 changed files with 16 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: ldebug.c,v 1.132 2002/08/12 17:23:12 roberto Exp roberto $
** $Id: ldebug.c,v 1.133 2002/08/20 20:03:05 roberto Exp roberto $
** Debug Interface
** See Copyright Notice in lua.h
*/
@@ -524,14 +524,11 @@ int luaG_ordererror (lua_State *L, const TObject *p1, const TObject *p2) {
static void addinfo (lua_State *L, const char *msg) {
CallInfo *ci = L->ci;
if (!isLua(ci)) { /* no Lua code? */
luaO_pushfstring(L, "%s\n", msg); /* no extra info; just add '\n' */
}
else { /* add file:line information */
char buff[LUA_IDSIZE];
if (isLua(ci)) { /* is Lua code? */
char buff[LUA_IDSIZE]; /* add file:line information */
int line = currentline(ci);
luaO_chunkid(buff, getstr(getluaproto(ci)->source), LUA_IDSIZE);
luaO_pushfstring(L, "%s:%d: %s\n", buff, line, msg);
luaO_pushfstring(L, "%s:%d: %s", buff, line, msg);
}
}