summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2000-02-22 12:00:00 +0000
committerrepogen <>2000-02-22 12:00:00 +0000
commitb7610da5fed99f59ac73ae452da8839a0f2c1bda (patch)
treedc18aa9fc220b4d560aa2a71949e885ca9c077bf
parente7eacfb8851d87e681e6f5a1fbead87565b4aa46 (diff)
downloadlua-github-b7610da5fed99f59ac73ae452da8839a0f2c1bda.tar.gz
Lua 3.2.23.2.2
-rw-r--r--include/lua.h4
-rw-r--r--src/lapi.c3
-rw-r--r--src/ldo.c8
3 files changed, 9 insertions, 6 deletions
diff --git a/include/lua.h b/include/lua.h
index 5635a550..03ebe7d0 100644
--- a/include/lua.h
+++ b/include/lua.h
@@ -1,5 +1,5 @@
/*
-** $Id: lua.h,v 1.32a 1999/05/11 20:29:19 roberto Exp $
+** $Id: lua.h,v 1.32b 1999/05/11 20:29:19 roberto Exp $
** Lua - An Extensible Extension Language
** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
** e-mail: lua@tecgraf.puc-rio.br
@@ -11,7 +11,7 @@
#ifndef lua_h
#define lua_h
-#define LUA_VERSION "Lua 3.2.1"
+#define LUA_VERSION "Lua 3.2.2"
#define LUA_COPYRIGHT "Copyright (C) 1994-1999 TeCGraf, PUC-Rio"
#define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo"
diff --git a/src/lapi.c b/src/lapi.c
index 0a5b99db..16bd9ff9 100644
--- a/src/lapi.c
+++ b/src/lapi.c
@@ -1,5 +1,5 @@
/*
-** $Id: lapi.c,v 1.47 1999/06/22 20:37:23 roberto Exp $
+** $Id: lapi.c,v 1.47b 1999/06/22 20:37:23 roberto Exp $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -179,6 +179,7 @@ lua_Object lua_rawgettable (void) {
void lua_settable (void) {
checkCparams(3);
+ luaD_checkstack(3); /* may need that to call T.M. */
luaV_settable(L->stack.top-3);
L->stack.top -= 2; /* pop table and index */
}
diff --git a/src/ldo.c b/src/ldo.c
index bf840bf4..281a4ec4 100644
--- a/src/ldo.c
+++ b/src/ldo.c
@@ -1,5 +1,5 @@
/*
-** $Id: ldo.c,v 1.45 1999/06/22 20:37:23 roberto Exp $
+** $Id: ldo.c,v 1.45b 1999/06/22 20:37:23 roberto Exp $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
@@ -357,12 +357,14 @@ int lua_dofile (char *filename) {
FILE *f = (filename == NULL) ? stdin : fopen(filename, "r");
if (f == NULL)
return 2;
+ luaL_filesource(source, filename, sizeof(source));
c = fgetc(f);
ungetc(c, f);
bin = (c == ID_CHUNK);
- if (bin)
+ if (bin && f != stdin) {
f = freopen(filename, "rb", f); /* set binary mode */
- luaL_filesource(source, filename, sizeof(source));
+ if (f == NULL) return 2;
+ }
luaZ_Fopen(&z, f, source);
status = do_main(&z, bin);
if (f != stdin)