aboutsummaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-08-31 17:23:40 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-08-31 17:23:40 -0300
commitf0b3cd1d6f35ba34091450d5e3057269114a17b6 (patch)
treeceffcf31f1823709b7ab4e63801e5e483abf8490 /lua.c
parentfb5e6d5ac498649b8e1b6bf068d18078ef70d523 (diff)
downloadlua-f0b3cd1d6f35ba34091450d5e3057269114a17b6.tar.gz
lua-f0b3cd1d6f35ba34091450d5e3057269114a17b6.tar.bz2
lua-f0b3cd1d6f35ba34091450d5e3057269114a17b6.zip
new API functions `pop', `insert', and `move'
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lua.c b/lua.c
index 8fd014d1..577ada06 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.47 2000/08/29 14:33:31 roberto Exp roberto $ 2** $Id: lua.c,v 1.48 2000/08/31 14:28:17 roberto Exp roberto $
3** Lua stand-alone interpreter 3** Lua stand-alone interpreter
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -87,7 +87,9 @@ static void laction (int i) {
87static int ldo (int (*f)(lua_State *l, const char *), const char *name) { 87static int ldo (int (*f)(lua_State *l, const char *), const char *name) {
88 int res; 88 int res;
89 handler h = lreset(); 89 handler h = lreset();
90 int top = lua_gettop(L);
90 res = f(L, name); /* dostring | dofile */ 91 res = f(L, name); /* dostring | dofile */
92 lua_settop(L, top); /* remove eventual results */
91 signal(SIGINT, h); /* restore old action */ 93 signal(SIGINT, h); /* restore old action */
92 if (res == LUA_ERRMEM) { 94 if (res == LUA_ERRMEM) {
93 /* Lua gives no message in such case, so lua.c provides one */ 95 /* Lua gives no message in such case, so lua.c provides one */
@@ -177,9 +179,9 @@ static void manual_input (int version, int prompt) {
177 const char *s; 179 const char *s;
178 lua_getglobal(L, "_PROMPT"); 180 lua_getglobal(L, "_PROMPT");
179 s = lua_tostring(L, -1); 181 s = lua_tostring(L, -1);
180 lua_settop(L, -1); /* remove global */
181 if (!s) s = PROMPT; 182 if (!s) s = PROMPT;
182 fputs(s, stdout); 183 fputs(s, stdout);
184 lua_pop(L, 1); /* remove global */
183 } 185 }
184 for(;;) { 186 for(;;) {
185 int c = getchar(); 187 int c = getchar();