aboutsummaryrefslogtreecommitdiff
path: root/ldblib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldblib.c')
-rw-r--r--ldblib.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ldblib.c b/ldblib.c
index be132a3f..1633a9e3 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldblib.c,v 1.118 2009/11/25 15:27:51 roberto Exp roberto $ 2** $Id: ldblib.c,v 1.119 2010/01/06 14:42:35 roberto Exp roberto $
3** Interface from Lua to its debug API 3** Interface from Lua to its debug API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -339,15 +339,13 @@ static int db_gethook (lua_State *L) {
339static int db_debug (lua_State *L) { 339static int db_debug (lua_State *L) {
340 for (;;) { 340 for (;;) {
341 char buffer[250]; 341 char buffer[250];
342 fputs("lua_debug> ", stderr); 342 luai_writestringerror("%s", "lua_debug> ");
343 if (fgets(buffer, sizeof(buffer), stdin) == 0 || 343 if (fgets(buffer, sizeof(buffer), stdin) == 0 ||
344 strcmp(buffer, "cont\n") == 0) 344 strcmp(buffer, "cont\n") == 0)
345 return 0; 345 return 0;
346 if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || 346 if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") ||
347 lua_pcall(L, 0, 0, 0)) { 347 lua_pcall(L, 0, 0, 0))
348 fputs(lua_tostring(L, -1), stderr); 348 luai_writestringerror("%s\n", lua_tostring(L, -1));
349 fputs("\n", stderr);
350 }
351 lua_settop(L, 0); /* remove eventual returns */ 349 lua_settop(L, 0); /* remove eventual returns */
352 } 350 }
353} 351}