diff options
Diffstat (limited to 'lbuiltin.c')
-rw-r--r-- | lbuiltin.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.29 1998/06/05 22:17:44 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.30 1998/06/19 16:14:09 roberto Exp roberto $ |
3 | ** Built-in functions | 3 | ** Built-in functions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -22,6 +22,7 @@ | |||
22 | #include "ltable.h" | 22 | #include "ltable.h" |
23 | #include "ltm.h" | 23 | #include "ltm.h" |
24 | #include "lua.h" | 24 | #include "lua.h" |
25 | #include "lundump.h" | ||
25 | 26 | ||
26 | 27 | ||
27 | 28 | ||
@@ -114,9 +115,11 @@ static void foreach (void) | |||
114 | 115 | ||
115 | static void internaldostring (void) | 116 | static void internaldostring (void) |
116 | { | 117 | { |
117 | if (lua_getparam(2) != LUA_NOOBJECT) | 118 | long l; |
118 | lua_error("invalid 2nd argument (probably obsolete code)"); | 119 | char *s = luaL_check_lstr(1, &l); |
119 | if (lua_dostring(luaL_check_string(1)) == 0) | 120 | if (*s == ID_CHUNK) |
121 | lua_error("`dostring' cannot run pre-compiled code"); | ||
122 | if (lua_dobuffer(s, l, luaL_opt_string(2, NULL)) == 0) | ||
120 | if (luaA_passresults() == 0) | 123 | if (luaA_passresults() == 0) |
121 | lua_pushuserdata(NULL); /* at least one result to signal no errors */ | 124 | lua_pushuserdata(NULL); /* at least one result to signal no errors */ |
122 | } | 125 | } |