summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2007-03-25 12:00:00 +0000
committerrepogen <>2007-03-25 12:00:00 +0000
commitcf61d326a6adbeb4ea9467af3fe4da1af8784f01 (patch)
tree49df3771ebb97aa16a40d2e96a67e2368f11f1e6
parent7e7bc7c7c7f3301a5f837579b81bcac4a2f9cccc (diff)
downloadlua-github-cf61d326a6adbeb4ea9467af3fe4da1af8784f01.tar.gz
Lua 5.1.2-rc25.1.2-rc2
-rw-r--r--Makefile13
-rw-r--r--etc/lua.pc2
-rw-r--r--etc/strict.lua9
-rw-r--r--src/Makefile9
-rw-r--r--src/luaconf.h4
-rw-r--r--src/lvm.c8
6 files changed, 27 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index b3678b10..c5ec666a 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,8 @@ PLAT= none
# Where to install. The installation starts in the src directory, so take care
# if INSTALL_TOP is not an absolute path. (Man pages are installed from the
-# doc directory.)
+# doc directory.) You may want to make these paths consistent with LUA_ROOT,
+# LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
#
INSTALL_TOP= /usr/local
INSTALL_BIN= $(INSTALL_TOP)/bin
@@ -37,7 +38,7 @@ RANLIB= ranlib
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
# Convenience platforms targets.
-PLATS= aix ansi bsd generic linux macosx mingw posix solaris
+PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
# What to install.
TO_BIN= lua luac
@@ -47,7 +48,7 @@ TO_MAN= lua.1 luac.1
# Lua version and release.
V= 5.1
-R= 5.1.1
+R= 5.1.2
all: $(PLAT)
@@ -119,11 +120,7 @@ lecho:
@$(MAKE) echo | grep = | sed -e 's/= /= "/' -e 's/$$/"/' #-e 's/""/nil/'
@echo "-- EOF"
-# show what has changed since we unpacked
-newer:
- @$(FIND) . -newer MANIFEST -type f
-
# list targets that do not create files (but not all makes understand .PHONY)
-.PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho newer
+.PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
# (end of Makefile)
diff --git a/etc/lua.pc b/etc/lua.pc
index 21a16bad..03a2e684 100644
--- a/etc/lua.pc
+++ b/etc/lua.pc
@@ -5,7 +5,7 @@
# grep '^V=' ../Makefile
V= 5.1
# grep '^R=' ../Makefile
-R= 5.1.1
+R= 5.1.2
# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
prefix= /usr/local
diff --git a/etc/strict.lua b/etc/strict.lua
index 7c9fa159..16ee26b4 100644
--- a/etc/strict.lua
+++ b/etc/strict.lua
@@ -14,9 +14,14 @@ end
mt.__declared = {}
+local function what ()
+ local d = debug.getinfo(3, "S")
+ return d and d.what or "C"
+end
+
mt.__newindex = function (t, n, v)
if not mt.__declared[n] then
- local w = debug.getinfo(2, "S").what
+ local w = what()
if w ~= "main" and w ~= "C" then
error("assign to undeclared variable '"..n.."'", 2)
end
@@ -26,7 +31,7 @@ mt.__newindex = function (t, n, v)
end
mt.__index = function (t, n)
- if not mt.__declared[n] and debug.getinfo(2, "S").what ~= "C" then
+ if not mt.__declared[n] and what() ~= "C" then
error("variable '"..n.."' is not declared", 2)
end
return rawget(t, n)
diff --git a/src/Makefile b/src/Makefile
index 0708ac47..cd7f6ba2 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -20,7 +20,7 @@ MYLIBS=
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
-PLATS= aix ansi bsd generic linux macosx mingw posix solaris
+PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
LUA_A= liblua.a
CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
@@ -77,7 +77,8 @@ echo:
# convenience targets for popular platforms
none:
- @echo "Please choose a platform: $(PLATS)"
+ @echo "Please choose a platform:"
+ @echo " $(PLATS)"
aix:
$(MAKE) all CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl" MYLDFLAGS="-brtl -bexpall"
@@ -88,6 +89,9 @@ ansi:
bsd:
$(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-Wl,-E"
+freebsd:
+ $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
+
generic:
$(MAKE) all MYCFLAGS=
@@ -103,6 +107,7 @@ mingw:
$(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
"AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
"MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
+ $(MAKE) "LUAC_T=luac.exe" luac.exe
posix:
$(MAKE) all MYCFLAGS=-DLUA_USE_POSIX
diff --git a/src/luaconf.h b/src/luaconf.h
index f32f1f76..8be8338f 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -1,5 +1,5 @@
/*
-** $Id: luaconf.h,v 1.82 2006/04/10 18:27:23 roberto Exp $
+** $Id: luaconf.h,v 1.82a 2006/04/10 18:27:23 roberto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -360,7 +360,7 @@
/*
@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'
@* behavior.
-** CHANGE it to undefined as soon as you replace to 'luaL_registry'
+** CHANGE it to undefined as soon as you replace to 'luaL_register'
** your uses of 'luaL_openlib'
*/
#define LUA_COMPAT_OPENLIB
diff --git a/src/lvm.c b/src/lvm.c
index 1e3ea4c8..35b92181 100644
--- a/src/lvm.c
+++ b/src/lvm.c
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 2.63 2006/06/05 15:58:59 roberto Exp $
+** $Id: lvm.c,v 2.63a 2006/06/05 15:58:59 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -281,10 +281,12 @@ void luaV_concat (lua_State *L, int total, int last) {
do {
StkId top = L->base + last + 1;
int n = 2; /* number of elements handled in this pass (at least 2) */
- if (!tostring(L, top-2) || !tostring(L, top-1)) {
+ if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) {
if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT))
luaG_concaterror(L, top-2, top-1);
- } else if (tsvalue(top-1)->len > 0) { /* if len=0, do nothing */
+ } else if (tsvalue(top-1)->len == 0) /* second op is empty? */
+ tostring(L, top - 2); /* result is first op (as string) */
+ else {
/* at least two string values; get as many as possible */
size_t tl = tsvalue(top-1)->len;
char *buffer;