aboutsummaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lua.c b/lua.c
index 3734f84e..a97530d6 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.41 2000/06/19 13:15:15 roberto Exp roberto $ 2** $Id: lua.c,v 1.42 2000/06/30 19:17:08 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*/
@@ -62,6 +62,10 @@ static int ldo (int (*f)(lua_State *L, const char *), const char *name) {
62 handler h = lreset(); 62 handler h = lreset();
63 res = f(lua_state, name); /* dostring | dofile */ 63 res = f(lua_state, name); /* dostring | dofile */
64 signal(SIGINT, h); /* restore old action */ 64 signal(SIGINT, h); /* restore old action */
65 if (res == LUA_ERRMEM) {
66 /* Lua gives no message in such case, so lua.c provides one */
67 fprintf(stderr, "lua: memory allocation error\n");
68 }
65 return res; 69 return res;
66} 70}
67 71
@@ -121,7 +125,7 @@ static void l_getargs (void) {
121static void file_input (const char *argv) { 125static void file_input (const char *argv) {
122 int result = ldo(lua_dofile, argv); 126 int result = ldo(lua_dofile, argv);
123 if (result) { 127 if (result) {
124 if (result == 2) { 128 if (result == LUA_ERRFILE) {
125 fprintf(stderr, "lua: cannot execute file "); 129 fprintf(stderr, "lua: cannot execute file ");
126 perror(argv); 130 perror(argv);
127 } 131 }