diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-05-31 16:27:14 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-05-31 16:27:14 -0300 |
| commit | 1e0aaf2156bb261787606b8cf00f812d75344ff2 (patch) | |
| tree | b9a63fff3455cc1c09f0e4d820855e47b0e8c997 /ldblib.c | |
| parent | 616438fe9ab5e3ae7d73e9ad838e9b7bdea1ea59 (diff) | |
| download | lua-1e0aaf2156bb261787606b8cf00f812d75344ff2.tar.gz lua-1e0aaf2156bb261787606b8cf00f812d75344ff2.tar.bz2 lua-1e0aaf2156bb261787606b8cf00f812d75344ff2.zip | |
`luaL_dofile' and `luaL_dostring' are deprecated
Diffstat (limited to 'ldblib.c')
| -rw-r--r-- | ldblib.c | 8 |
1 files changed, 6 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldblib.c,v 1.84 2003/11/05 11:59:14 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.85 2004/04/30 20:13:38 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 | */ |
| @@ -261,7 +261,11 @@ static int debug (lua_State *L) { | |||
| 261 | if (fgets(buffer, sizeof(buffer), stdin) == 0 || | 261 | if (fgets(buffer, sizeof(buffer), stdin) == 0 || |
| 262 | strcmp(buffer, "cont\n") == 0) | 262 | strcmp(buffer, "cont\n") == 0) |
| 263 | return 0; | 263 | return 0; |
| 264 | lua_dostring(L, buffer); | 264 | if (luaL_loadbuffer(L, buffer, strlen(buffer), "=debug command") || |
| 265 | lua_pcall(L, 0, 0, 0)) { | ||
| 266 | fputs(lua_tostring(L, -1), stderr); | ||
| 267 | fputs("\n", stderr); | ||
| 268 | } | ||
| 265 | lua_settop(L, 0); /* remove eventual returns */ | 269 | lua_settop(L, 0); /* remove eventual returns */ |
| 266 | } | 270 | } |
| 267 | } | 271 | } |
