diff options
Diffstat (limited to 'inout.c')
-rw-r--r-- | inout.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -5,7 +5,7 @@ | |||
5 | ** Also provides some predefined lua functions. | 5 | ** Also provides some predefined lua functions. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | char *rcs_inout="$Id: inout.c,v 2.26 1996/01/22 17:40:00 roberto Exp roberto $"; | 8 | char *rcs_inout="$Id: inout.c,v 2.27 1996/01/26 14:05:28 roberto Exp roberto $"; |
9 | 9 | ||
10 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | #include <stdlib.h> | 11 | #include <stdlib.h> |
@@ -122,7 +122,13 @@ void lua_internaldostring (void) | |||
122 | void lua_internaldofile (void) | 122 | void lua_internaldofile (void) |
123 | { | 123 | { |
124 | lua_Object obj = lua_getparam (1); | 124 | lua_Object obj = lua_getparam (1); |
125 | if (lua_isstring(obj) && !lua_dofile(lua_getstring(obj))) | 125 | char *fname = NULL; |
126 | if (lua_isstring(obj)) | ||
127 | fname = lua_getstring(obj); | ||
128 | else if (obj != LUA_NOOBJECT) | ||
129 | lua_error("invalid argument to function `dofile'"); | ||
130 | /* else fname = NULL */ | ||
131 | if (!lua_dofile(fname)) | ||
126 | lua_pushnumber(1); | 132 | lua_pushnumber(1); |
127 | else | 133 | else |
128 | lua_pushnil(); | 134 | lua_pushnil(); |