From 1e0aaf2156bb261787606b8cf00f812d75344ff2 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 31 May 2004 16:27:14 -0300 Subject: `luaL_dofile' and `luaL_dostring' are deprecated --- ldblib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ldblib.c') diff --git a/ldblib.c b/ldblib.c index 2e121aa9..af575bd7 100644 --- a/ldblib.c +++ b/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.84 2003/11/05 11:59:14 roberto Exp roberto $ +** $Id: ldblib.c,v 1.85 2004/04/30 20:13:38 roberto Exp roberto $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -261,7 +261,11 @@ static int debug (lua_State *L) { if (fgets(buffer, sizeof(buffer), stdin) == 0 || strcmp(buffer, "cont\n") == 0) return 0; - lua_dostring(L, buffer); + if (luaL_loadbuffer(L, buffer, strlen(buffer), "=debug command") || + lua_pcall(L, 0, 0, 0)) { + fputs(lua_tostring(L, -1), stderr); + fputs("\n", stderr); + } lua_settop(L, 0); /* remove eventual returns */ } } -- cgit v1.2.3-55-g6feb