From 955def034814e96f5f8e42def2e47ca6817ef103 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 16 May 2002 15:39:46 -0300 Subject: new names for string formating functions --- ldblib.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'ldblib.c') diff --git a/ldblib.c b/ldblib.c index da0a90f5..5ef7d428 100644 --- a/ldblib.c +++ b/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.51 2002/05/07 17:36:56 roberto Exp roberto $ +** $Id: ldblib.c,v 1.52 2002/05/15 18:57:44 roberto Exp roberto $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -41,7 +41,7 @@ static int getinfo (lua_State *L) { } } else if (lua_isfunction(L, 1)) { - luaL_vstr(L, ">%s", options); + lua_pushfstring(L, ">%s", options); options = lua_tostring(L, -1); lua_pushvalue(L, 1); } @@ -207,23 +207,24 @@ static int errorfb (lua_State *L) { sprintf(buff, "%4d- ", level-1); lua_pushstring(L, buff); lua_getinfo(L, "Snl", &ar); - luaL_vstr(L, "%s:", ar.short_src); + lua_pushfstring(L, "%s:", ar.short_src); if (ar.currentline > 0) - luaL_vstr(L, "%d:", ar.currentline); + lua_pushfstring(L, "%d:", ar.currentline); switch (*ar.namewhat) { case 'g': /* global */ case 'l': /* local */ case 'f': /* field */ case 'm': /* method */ - luaL_vstr(L, " in function `%s'", ar.name); + lua_pushfstring(L, " in function `%s'", ar.name); break; default: { if (*ar.what == 'm') /* main? */ - luaL_vstr(L, " in main chunk"); + lua_pushfstring(L, " in main chunk"); else if (*ar.what == 'C') /* C function? */ - luaL_vstr(L, "%s", ar.short_src); + lua_pushfstring(L, "%s", ar.short_src); else - luaL_vstr(L, " in function <%s:%d>", ar.short_src, ar.linedefined); + lua_pushfstring(L, " in function <%s:%d>", + ar.short_src, ar.linedefined); } } lua_pushliteral(L, "\n"); -- cgit v1.2.3-55-g6feb