summaryrefslogtreecommitdiff
path: root/inout.c
diff options
context:
space:
mode:
Diffstat (limited to 'inout.c')
-rw-r--r--inout.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/inout.c b/inout.c
index 23d69158..d76bff8c 100644
--- a/inout.c
+++ b/inout.c
@@ -5,7 +5,7 @@
5** Also provides some predefined lua functions. 5** Also provides some predefined lua functions.
6*/ 6*/
7 7
8char *rcs_inout="$Id: inout.c,v 2.26 1996/01/22 17:40:00 roberto Exp roberto $"; 8char *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)
122void lua_internaldofile (void) 122void 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();