diff options
Diffstat (limited to 'lua.c')
-rw-r--r-- | lua.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) { | |||
121 | static void file_input (const char *argv) { | 125 | static 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 | } |