[-]
[+]
|
Deleted |
lua51.changes
|
@@ -1,5 +0,0 @@
--------------------------------------------------------------------
-Mon Nov 27 20:16:56 CET 2006 - mrueckert@suse.de
-
-- actually build again
-
|
[-]
[+]
|
Changed |
lua.spec
^
|
|
[-]
[+]
|
Deleted |
lua51.spec
^
|
@@ -1,111 +0,0 @@
-#
-# spec file for package lua51 (Version 5.1)
-#
-# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
-#
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
-#
-
-# norootforbuild
-
-Name: lua51
-%define pkg_name lua
-%define pkg_major 5.1
-Version: 5.1
-Release: 1
-#
-Group: Development/Languages/Lua
-License: MIT
-#
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: ncurses-devel readline-devel
-#
-Url: http://www.lua.org/
-Source0: http://www.lua.org/ftp/lua-%{version}.tar.gz
-Source1: http://www.lua.org/ftp/refman-5.0.pdf
-Patch0: lua-5.1-autotoolize-r1.patch.bz2
-Patch1: lua51-5.1.1_pkgconfig_libdir.patch
-Patch2: lua-5.1_automake18.patch
-#
-Summary: Powerful light-weight programming language
-
-%description
-Lua is a powerful light-weight programming language designed for
-extending applications. Lua is also frequently used as a
-general-purpose, stand-alone language. Lua is free software.
-Lua combines simple procedural syntax with powerful data description
-constructs based on associative arrays and extensible semantics. Lua
-is dynamically typed, interpreted from bytecodes, and has automatic
-memory management with garbage collection, making it ideal for
-configuration, scripting, and rapid prototyping.
-
-%package libs
-Summary: Development files for %{pkg_name}
-Group: Development/Languages/Lua
-
-%description libs
-Libraries for lua 5.1
-
-%package devel
-Summary: Development files for %{pkg_name}
-Group: Development/Languages/Lua
-Requires: %{name} = %{version}-%{release}
-Requires: ncurses-devel, readline-devel, pkgconfig
-
-%description devel
-This package contains development files for %{pkg_name}.
-
-%prep
-%setup -q -n %{pkg_name}-%{version}
-%patch0 -p1
-%patch1
-%patch2
-%{__cp} %{S:1} .
-
-%build
-# fix perms on auto files
-chmod u+x autogen.sh config.guess config.sub configure depcomp install-sh missing
-./autogen.sh
-%configure --with-readline
-%{__make}
-
-%install
-%makeinstall -C src
-find %{buildroot} -type f -name "*.la" -exec rm -f {} ';'
-%{__install} -d -m 0755 %{buildroot}{%{_datadir},%{_libdir}}/lua/%{pkg_major}/ %{buildroot}%{_mandir}/man1/
-%{__install} -m 0644 doc/*.1 %{buildroot}%{_mandir}/man1/
-%{__install} -m 0644 -D etc/lua.pc %{buildroot}%{_libdir}/pkgconfig/lua.pc
-
-%clean
-%{__rm} -rf %{buildroot}
-
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
-
-%files
-%defattr(-,root,root,-)
-%doc COPYRIGHT HISTORY README doc/*.html doc/*.gif *.pdf
-%{_bindir}/lua*
-%{_mandir}/man1/lua*.1*
-
-%files libs
-%defattr(-,root,root,-)
-%{_libdir}/liblua-*.so
-%dir %{_datadir}/lua/
-%dir %{_libdir}/lua/
-%dir %{_datadir}/lua/%{pkg_major}/
-%dir %{_libdir}/lua/%{pkg_major}/
-
-%files devel
-%defattr(-,root,root,-)
-%{_includedir}/l*.h
-%{_libdir}/liblua.so
-%{_libdir}/*.a
-%{_libdir}/pkgconfig/*.pc
-
-%changelog -n lua51
-* Mon Nov 27 2006 - mrueckert@suse.de
-- actually build again
|
[-]
[+]
|
Deleted |
lua-5.1-autotoolize-r1.patch.bz2
^
|
@@ -1,43604 +0,0 @@
-diff -urN lua-5.1/aclocal.m4 lua-at-5.1/aclocal.m4
---- lua-5.1/aclocal.m4 1970-01-01 02:00:00.000000000 +0200
-+++ lua-at-5.1/aclocal.m4 2006-05-06 11:02:39.000000000 +0300
-@@ -0,0 +1,7307 @@
-+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
-+
-+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-+# 2005 Free Software Foundation, Inc.
-+# This file is free software; the Free Software Foundation
-+# gives unlimited permission to copy and/or distribute it,
-+# with or without modifications, as long as this notice is preserved.
-+
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-+# PARTICULAR PURPOSE.
-+
-+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-+
-+# serial 48 AC_PROG_LIBTOOL
-+
-+
-+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-+# -----------------------------------------------------------
-+# If this macro is not defined by Autoconf, define it here.
-+m4_ifdef([AC_PROVIDE_IFELSE],
-+ [],
-+ [m4_define([AC_PROVIDE_IFELSE],
-+ [m4_ifdef([AC_PROVIDE_$1],
-+ [$2], [$3])])])
-+
-+
-+# AC_PROG_LIBTOOL
-+# ---------------
-+AC_DEFUN([AC_PROG_LIBTOOL],
-+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
-+ AC_PROVIDE_IFELSE([AC_PROG_CXX],
-+ [AC_LIBTOOL_CXX],
-+ [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
-+ ])])
-+dnl And a similar setup for Fortran 77 support
-+ AC_PROVIDE_IFELSE([AC_PROG_F77],
-+ [AC_LIBTOOL_F77],
-+ [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-+])])
-+
-+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
-+ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-+ [AC_LIBTOOL_GCJ],
-+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-+ [AC_LIBTOOL_GCJ],
-+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
-+ [AC_LIBTOOL_GCJ],
-+ [ifdef([AC_PROG_GCJ],
-+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-+ ifdef([A][M_PROG_GCJ],
-+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-+ ifdef([LT_AC_PROG_GCJ],
-+ [define([LT_AC_PROG_GCJ],
-+ defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-+])])# AC_PROG_LIBTOOL
-+
-+
-+# _AC_PROG_LIBTOOL
-+# ----------------
-+AC_DEFUN([_AC_PROG_LIBTOOL],
-+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-+
-+# This can be used to rebuild libtool when needed
-+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-+
-+# Always use our own libtool.
-+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-+AC_SUBST(LIBTOOL)dnl
-+
-+# Prevent multiple expansion
-+define([AC_PROG_LIBTOOL], [])
-+])# _AC_PROG_LIBTOOL
-+
-+
-+# AC_LIBTOOL_SETUP
-+# ----------------
-+AC_DEFUN([AC_LIBTOOL_SETUP],
-+[AC_PREREQ(2.50)dnl
-+AC_REQUIRE([AC_ENABLE_SHARED])dnl
-+AC_REQUIRE([AC_ENABLE_STATIC])dnl
-+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-+AC_REQUIRE([AC_CANONICAL_HOST])dnl
-+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-+AC_REQUIRE([AC_PROG_CC])dnl
-+AC_REQUIRE([AC_PROG_LD])dnl
-+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-+AC_REQUIRE([AC_PROG_NM])dnl
-+
-+AC_REQUIRE([AC_PROG_LN_S])dnl
-+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-+AC_REQUIRE([AC_OBJEXT])dnl
-+AC_REQUIRE([AC_EXEEXT])dnl
-+dnl
-+
-+AC_LIBTOOL_SYS_MAX_CMD_LEN
-+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-+AC_LIBTOOL_OBJDIR
-+
-+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-+_LT_AC_PROG_ECHO_BACKSLASH
-+
-+case $host_os in
-+aix3*)
-+ # AIX sometimes has problems with the GCC collect2 program. For some
-+ # reason, if we set the COLLECT_NAMES environment variable, the problems
-+ # vanish in a puff of smoke.
-+ if test "X${COLLECT_NAMES+set}" != Xset; then
-+ COLLECT_NAMES=
-+ export COLLECT_NAMES
-+ fi
-+ ;;
-+esac
-+
-+# Sed substitution that helps us do robust quoting. It backslashifies
-+# metacharacters that are still active within double-quoted strings.
-+Xsed='sed -e 1s/^X//'
-+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
-+
-+# Same as above, but do not quote variable references.
-+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
-+
-+# Sed substitution to delay expansion of an escaped shell variable in a
-+# double_quote_subst'ed string.
-+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-+
-+# Sed substitution to avoid accidental globbing in evaled expressions
-+no_glob_subst='s/\*/\\\*/g'
-+
-+# Constants:
-+rm="rm -f"
-+
-+# Global variables:
-+default_ofile=libtool
-+can_build_shared=yes
-+
-+# All known linkers require a `.a' archive for static linking (except MSVC,
-+# which needs '.lib').
-+libext=a
-+ltmain="$ac_aux_dir/ltmain.sh"
-+ofile="$default_ofile"
-+with_gnu_ld="$lt_cv_prog_gnu_ld"
-+
-+AC_CHECK_TOOL(AR, ar, false)
-+AC_CHECK_TOOL(RANLIB, ranlib, :)
-+AC_CHECK_TOOL(STRIP, strip, :)
-+
-+old_CC="$CC"
-+old_CFLAGS="$CFLAGS"
-+
-+# Set sane defaults for various variables
-+test -z "$AR" && AR=ar
-+test -z "$AR_FLAGS" && AR_FLAGS=cru
-+test -z "$AS" && AS=as
-+test -z "$CC" && CC=cc
-+test -z "$LTCC" && LTCC=$CC
-+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-+test -z "$DLLTOOL" && DLLTOOL=dlltool
-+test -z "$LD" && LD=ld
-+test -z "$LN_S" && LN_S="ln -s"
-+test -z "$MAGIC_CMD" && MAGIC_CMD=file
-+test -z "$NM" && NM=nm
-+test -z "$SED" && SED=sed
-+test -z "$OBJDUMP" && OBJDUMP=objdump
-+test -z "$RANLIB" && RANLIB=:
-+test -z "$STRIP" && STRIP=:
-+test -z "$ac_objext" && ac_objext=o
-+
-+# Determine commands to create old-style static archives.
-+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-+old_postinstall_cmds='chmod 644 $oldlib'
-+old_postuninstall_cmds=
-+
-+if test -n "$RANLIB"; then
-+ case $host_os in
-+ openbsd*)
-+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-+ ;;
-+ *)
-+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-+ ;;
-+ esac
-+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-+fi
-+
-+_LT_CC_BASENAME([$compiler])
|
[-]
[+]
|
Deleted |
lua-5.1.3-autotoolize.patch
^
|
@@ -1,43652 +0,0 @@
-diff -up /dev/null lua-5.1.3/config.h.in
---- /dev/null 2008-01-26 09:26:21.331005882 +0100
-+++ lua-5.1.3/config.h.in 2008-01-26 11:16:57.000000000 +0100
-@@ -0,0 +1,64 @@
-+/* config.h.in. Generated from configure.ac by autoheader. */
-+
-+/* Define to 1 if you have the <dlfcn.h> header file. */
-+#undef HAVE_DLFCN_H
-+
-+/* Define to 1 if you have the <inttypes.h> header file. */
-+#undef HAVE_INTTYPES_H
-+
-+/* Define to 1 if you have the `readline' library (-lreadline). */
-+#undef HAVE_LIBREADLINE
-+
-+/* Define to 1 if you have the <memory.h> header file. */
-+#undef HAVE_MEMORY_H
-+
-+/* Define to 1 if you have the <readline/history.h> header file. */
-+#undef HAVE_READLINE_HISTORY_H
-+
-+/* Define to 1 if you have the <readline/readline.h> header file. */
-+#undef HAVE_READLINE_READLINE_H
-+
-+/* Define to 1 if you have the <stdint.h> header file. */
-+#undef HAVE_STDINT_H
-+
-+/* Define to 1 if you have the <stdlib.h> header file. */
-+#undef HAVE_STDLIB_H
-+
-+/* Define to 1 if you have the <strings.h> header file. */
-+#undef HAVE_STRINGS_H
-+
-+/* Define to 1 if you have the <string.h> header file. */
-+#undef HAVE_STRING_H
-+
-+/* Define to 1 if you have the <sys/stat.h> header file. */
-+#undef HAVE_SYS_STAT_H
-+
-+/* Define to 1 if you have the <sys/types.h> header file. */
-+#undef HAVE_SYS_TYPES_H
-+
-+/* Define to 1 if you have the <unistd.h> header file. */
-+#undef HAVE_UNISTD_H
-+
-+/* Name of package */
-+#undef PACKAGE
-+
-+/* Define to the address where bug reports for this package should be sent. */
-+#undef PACKAGE_BUGREPORT
-+
-+/* Define to the full name of this package. */
-+#undef PACKAGE_NAME
-+
-+/* Define to the full name and version of this package. */
-+#undef PACKAGE_STRING
-+
-+/* Define to the one symbol short name of this package. */
-+#undef PACKAGE_TARNAME
-+
-+/* Define to the version of this package. */
-+#undef PACKAGE_VERSION
-+
-+/* Define to 1 if you have the ANSI C header files. */
-+#undef STDC_HEADERS
-+
-+/* Version number of package */
-+#undef VERSION
-diff -up /dev/null lua-5.1.3/ltmain.sh
---- /dev/null 2008-01-26 09:26:21.331005882 +0100
-+++ lua-5.1.3/ltmain.sh 2008-01-26 11:16:57.000000000 +0100
-@@ -0,0 +1,6971 @@
-+# ltmain.sh - Provide generalized library-building support services.
-+# NOTE: Changing this file will not affect anything until you rerun configure.
-+#
-+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-+# Free Software Foundation, Inc.
-+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful, but
-+# WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+# General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+#
-+# As a special exception to the GNU General Public License, if you
-+# distribute this file as part of a program that contains a
-+# configuration script generated by Autoconf, you may include it under
-+# the same distribution terms that you use for the rest of that program.
-+
-+basename="s,^.*/,,g"
-+
-+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-+# is ksh but when the shell is invoked as "sh" and the current value of
-+# the _XPG environment variable is not equal to 1 (one), the special
-+# positional parameter $0, within a function call, is the name of the
-+# function.
-+progpath="$0"
-+
-+# define SED for historic ltconfig's generated by Libtool 1.3
-+test -z "$SED" && SED=sed
-+
-+# The name of this program:
-+progname=`echo "$progpath" | $SED $basename`
-+modename="$progname"
-+
-+# Global variables:
-+EXIT_SUCCESS=0
-+EXIT_FAILURE=1
-+
-+PROGRAM=ltmain.sh
-+PACKAGE=libtool
-+VERSION=1.5.22
-+TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
-+
-+# See if we are running on zsh, and set the options which allow our
-+# commands through without removal of \ escapes.
-+if test -n "${ZSH_VERSION+set}" ; then
-+ setopt NO_GLOB_SUBST
-+fi
-+# Same for EGREP, and just to be sure, do LTCC as well
-+if test "X$EGREP" = X ; then
-+ EGREP=egrep
-+fi
-+if test "X$LTCC" = X ; then
-+ LTCC=${CC-gcc}
-+fi
-+
-+# Check that we have a working $echo.
-+if test "X$1" = X--no-reexec; then
-+ # Discard the --no-reexec flag, and continue.
-+ shift
-+elif test "X$1" = X--fallback-echo; then
-+ # Avoid inline document here, it may be left over
-+ :
-+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
-+ # Yippee, $echo works!
-+ :
-+else
-+ # Restart under the correct shell, and then maybe $echo will work.
-+ exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-+fi
-+
-+if test "X$1" = X--fallback-echo; then
-+ # used as fallback echo
-+ shift
-+ cat <<EOF
-+$*
-+EOF
-+ exit $EXIT_SUCCESS
-+fi
-+
-+default_mode=
-+help="Try \`$progname --help' for more information."
-+magic="%%%MAGIC variable%%%"
-+mkdir="mkdir"
-+mv="mv -f"
-+rm="rm -f"
-+
-+# Sed substitution that helps us do robust quoting. It backslashifies
-+# metacharacters that are still active within double-quoted strings.
-+Xsed="${SED}"' -e 1s/^X//'
-+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-+# test EBCDIC or ASCII
-+case `echo X|tr X '\101'` in
-+ A) # ASCII based system
-+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-+ SP2NL='tr \040 \012'
-+ NL2SP='tr \015\012 \040\040'
-+ ;;
-+ *) # EBCDIC based system
-+ SP2NL='tr \100 \n'
-+ NL2SP='tr \r\n \100\100'
-+ ;;
-+esac
-+
-+# NLS nuisances.
-+# Only set LANG and LC_ALL to C if already set.
-+# These must not be set unconditionally because not all systems understand
-+# e.g. LANG=C (notably SCO).
-+# We save the old values to restore during execute mode.
-+if test "${LC_ALL+set}" = set; then
-+ save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
-+fi
-+if test "${LANG+set}" = set; then
-+ save_LANG="$LANG"; LANG=C; export LANG
-+fi
-+
-+# Make sure IFS has a sensible default
-+lt_nl='
-+'
|
[-]
[+]
|
Added |
lua-5.1.4-libdir.diff
^
|
@@ -0,0 +1,13 @@
+Index: lua-5.1.4/etc/lua.pc
+===================================================================
+--- lua-5.1.4.orig/etc/lua.pc
++++ lua-5.1.4/etc/lua.pc
+@@ -25,7 +25,7 @@ Name: Lua
+ Description: An Extensible Extension Language
+ Version: ${R}
+ Requires:
+-Libs: -L${libdir} -llua -lm
++Libs: -llua -lm
+ Cflags: -I${includedir}
+
+ # (end of lua.pc)
|
[-]
[+]
|
Added |
lua-5.1.4-module-path.diff
^
|
@@ -0,0 +1,21 @@
+diff -urNad trunk~/src/luaconf.h trunk/src/luaconf.h
+--- trunk~/src/luaconf.h 2006-02-10 12:44:06.000000000 -0500
++++ trunk/src/luaconf.h 2006-02-17 21:32:55.000000000 -0500
+@@ -83,13 +83,17 @@
+
+ #else
+ #define LUA_ROOT "/usr/local/"
++#define LUA_ROOT2 "/usr/"
+ #define LUA_LDIR LUA_ROOT "share/lua/5.1/"
++#define LUA_LDIR2 LUA_ROOT2 "share/lua/5.1/"
+ #define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
++#define LUA_CDIR2 LUA_ROOT2 "LIBDIR/lua/5.1/"
+ #define LUA_PATH_DEFAULT \
+ "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
+- LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua"
++ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
++ LUA_LDIR2"?.lua;" LUA_LDIR2"?/init.lua"
+ #define LUA_CPATH_DEFAULT \
+- "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
++ "./?.so;" LUA_CDIR"?.so;" LUA_CDIR2"?.so;" LUA_CDIR"loadall.so"
+ #endif
|
[-]
[+]
|
Added |
lua-5.1.4-shared.diff
^
|
@@ -0,0 +1,91 @@
+Index: etc/lua.pc
+===================================================================
+--- etc/lua.pc.orig
++++ etc/lua.pc
+@@ -8,7 +8,7 @@ V= 5.1
+ R= 5.1.4
+
+ # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
+-prefix= /usr/local
++prefix= /usr
+ INSTALL_BIN= ${prefix}/bin
+ INSTALL_INC= ${prefix}/include
+ INSTALL_LIB= ${prefix}/lib
+Index: src/luaconf.h
+===================================================================
+--- src/luaconf.h.orig
++++ src/luaconf.h
+@@ -184,7 +184,7 @@
+
+ #elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
+ defined(__ELF__)
+-#define LUAI_FUNC __attribute__((visibility("hidden"))) extern
++#define LUAI_FUNC extern
+ #define LUAI_DATA LUAI_FUNC
+
+ #else
+Index: src/Makefile
+===================================================================
+--- src/Makefile.orig
++++ src/Makefile
+@@ -23,6 +23,7 @@ MYLIBS=
+ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+
+ LUA_A= liblua.a
++LUA_SO= liblua.so
+ CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
+ lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
+ lundump.o lvm.o lzio.o
+@@ -36,7 +37,7 @@ LUAC_T= luac
+ LUAC_O= luac.o print.o
+
+ ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
++ALL_T= $(LUA_SO) $(LUA_A) $(LUA_T) $(LUAC_T)
+ ALL_A= $(LUA_A)
+
+ default: $(PLAT)
+@@ -47,15 +48,20 @@ o: $(ALL_O)
+
+ a: $(ALL_A)
+
++# shared libraries (for Linux)
++$(LUA_SO): $(CORE_O) $(LIB_O)
++ $(CC) -o $(LUA_SO).$V -shared -Wl,-soname,$(LUA_SO).$V $(CORE_O) $(LIB_O) -lm -ldl
++ ln -fs $(LUA_SO).$(V) $(LUA_SO)
++
+ $(LUA_A): $(CORE_O) $(LIB_O)
+ $(AR) $@ $?
+ $(RANLIB) $@
+
+ $(LUA_T): $(LUA_O) $(LUA_A)
+- $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
++ $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) -L. -llua $(LIBS)
+
+ $(LUAC_T): $(LUAC_O) $(LUA_A)
+- $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
++ $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) -L. -llua $(LIBS)
+
+ clean:
+ $(RM) $(ALL_T) $(ALL_O)
+Index: Makefile
+===================================================================
+--- Makefile.orig
++++ Makefile
+@@ -43,7 +43,7 @@ PLATS= aix ansi bsd freebsd generic linu
+ # What to install.
+ TO_BIN= lua luac
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
+-TO_LIB= liblua.a
++TO_LIB= liblua.a liblua.so.$(V)
+ TO_MAN= lua.1 luac.1
+
+ # Lua version and release.
+@@ -62,6 +62,7 @@ install: dummy
+ cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+ cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
+ cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
++ ln -s liblua.so.$(V) $(INSTALL_LIB)/liblua.so
+ cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
+ cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+
|
[-]
[+]
|
Added |
lua-5.1.4-upstream-bugfix.diff
^
|
@@ -0,0 +1,196 @@
+# patch-lua-5.1.4-2 created 2010-05-14T21:02:40-0300
+# apply to a pristine copy of Lua 5.1.4 with:
+# wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
+# tar zxf lua-5.1.4.tar.gz
+# cd lua-5.1.4/src
+# wget http://www.lua.org/ftp/patch-lua-5.1.4-2
+# patch < patch-lua-5.1.4-2
+# use curl -O -R if you don't have wget
+
+--- src/lcode.c 2007/12/28 15:32:23 2.25.1.3
++++ src/lcode.c 2009/06/15 14:12:25 2.25.1.4
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
++** $Id: lcode.c,v 2.25.1.4 2009/06/15 14:12:25 roberto Exp $
+ ** Code generator for Lua
+ ** See Copyright Notice in lua.h
+ */
+@@ -544,15 +544,18 @@
+ pc = NO_JUMP; /* always true; do nothing */
+ break;
+ }
+- case VFALSE: {
+- pc = luaK_jump(fs); /* always jump */
+- break;
+- }
+ case VJMP: {
+ invertjump(fs, e);
+ pc = e->u.s.info;
+ break;
+ }
++ case VFALSE: {
++ if (!hasjumps(e)) {
++ pc = luaK_jump(fs); /* always jump */
++ break;
++ }
++ /* else go through */
++ }
+ default: {
+ pc = jumponcond(fs, e, 0);
+ break;
+@@ -572,14 +575,17 @@
+ pc = NO_JUMP; /* always false; do nothing */
+ break;
+ }
+- case VTRUE: {
+- pc = luaK_jump(fs); /* always jump */
+- break;
+- }
+ case VJMP: {
+ pc = e->u.s.info;
+ break;
+ }
++ case VTRUE: {
++ if (!hasjumps(e)) {
++ pc = luaK_jump(fs); /* always jump */
++ break;
++ }
++ /* else go through */
++ }
+ default: {
+ pc = jumponcond(fs, e, 1);
+ break;
+--- src/ldblib.c 2008/01/21 13:11:21 1.104.1.3
++++ src/ldblib.c 2009/08/04 18:50:18 1.104.1.4
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
++** $Id: ldblib.c,v 1.104.1.4 2009/08/04 18:50:18 roberto Exp $
+ ** Interface from Lua to its debug API
+ ** See Copyright Notice in lua.h
+ */
+@@ -45,6 +45,7 @@
+
+
+ static int db_getfenv (lua_State *L) {
++ luaL_checkany(L, 1);
+ lua_getfenv(L, 1);
+ return 1;
+ }
+--- src/liolib.c 2008/01/18 17:47:43 2.73.1.3
++++ src/liolib.c 2010/05/14 15:33:51 2.73.1.4
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $
++** $Id: liolib.c,v 2.73.1.4 2010/05/14 15:33:51 roberto Exp $
+ ** Standard I/O (and system) library
+ ** See Copyright Notice in lua.h
+ */
+@@ -276,7 +276,10 @@
+ lua_pushnumber(L, d);
+ return 1;
+ }
+- else return 0; /* read fails */
++ else {
++ lua_pushnil(L); /* "result" to be removed */
++ return 0; /* read fails */
++ }
+ }
+
+
+--- src/llex.c 2007/12/27 13:02:25 2.20.1.1
++++ src/llex.c 2009/11/23 14:58:22 2.20.1.2
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
++** $Id: llex.c,v 2.20.1.2 2009/11/23 14:58:22 roberto Exp $
+ ** Lexical Analyzer
+ ** See Copyright Notice in lua.h
+ */
+@@ -118,8 +118,10 @@
+ lua_State *L = ls->L;
+ TString *ts = luaS_newlstr(L, str, l);
+ TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
+- if (ttisnil(o))
++ if (ttisnil(o)) {
+ setbvalue(o, 1); /* make sure `str' will not be collected */
++ luaC_checkGC(L);
++ }
+ return ts;
+ }
+
+--- src/loadlib.c 2008/08/06 13:29:28 1.52.1.3
++++ src/loadlib.c 2009/09/09 13:17:16 1.52.1.4
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $
++** $Id: loadlib.c,v 1.52.1.4 2009/09/09 13:17:16 roberto Exp $
+ ** Dynamic library loader for Lua
+ ** See Copyright Notice in lua.h
+ **
+@@ -639,7 +639,7 @@
+ lua_pushvalue(L, -1);
+ lua_replace(L, LUA_ENVIRONINDEX);
+ /* create `loaders' table */
+- lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1);
++ lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0);
+ /* fill it with pre-defined loaders */
+ for (i=0; loaders[i] != NULL; i++) {
+ lua_pushcfunction(L, loaders[i]);
+--- src/lstrlib.c 2008/07/11 17:27:21 1.132.1.4
++++ src/lstrlib.c 2010/05/14 15:34:19 1.132.1.5
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $
++** $Id: lstrlib.c,v 1.132.1.5 2010/05/14 15:34:19 roberto Exp $
+ ** Standard library for string operations and pattern-matching
+ ** See Copyright Notice in lua.h
+ */
+@@ -754,6 +754,7 @@
+
+
+ static int str_format (lua_State *L) {
++ int top = lua_gettop(L);
+ int arg = 1;
+ size_t sfl;
+ const char *strfrmt = luaL_checklstring(L, arg, &sfl);
+@@ -768,7 +769,8 @@
+ else { /* format item */
+ char form[MAX_FORMAT]; /* to store the format (`%...') */
+ char buff[MAX_ITEM]; /* to store the formatted item */
+- arg++;
++ if (++arg > top)
++ luaL_argerror(L, arg, "no value");
+ strfrmt = scanformat(L, strfrmt, form);
+ switch (*strfrmt++) {
+ case 'c': {
+--- src/lvm.c 2007/12/28 15:32:23 2.63.1.3
++++ src/lvm.c 2009/07/01 21:10:33 2.63.1.4
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
++** $Id: lvm.c,v 2.63.1.4 2009/07/01 21:10:33 roberto Exp $
+ ** Lua virtual machine
+ ** See Copyright Notice in lua.h
+ */
+@@ -133,6 +133,7 @@
+
+ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
+ int loop;
++ TValue temp;
+ for (loop = 0; loop < MAXTAGLOOP; loop++) {
+ const TValue *tm;
+ if (ttistable(t)) { /* `t' is a table? */
+@@ -152,7 +153,9 @@
+ callTM(L, tm, t, key, val);
+ return;
+ }
+- t = tm; /* else repeat with `tm' */
++ /* else repeat with `tm' */
++ setobj(L, &temp, tm); /* avoid pointing inside table (may rehash) */
++ t = &temp;
+ }
+ luaG_runerror(L, "loop in settable");
+ }
+
|
[-]
[+]
|
Deleted |
lua-5.1_automake18.patch
^
|
@@ -1,13 +0,0 @@
-Index: configure.ac
-===================================================================
---- configure.ac.orig
-+++ configure.ac
-@@ -4,7 +4,7 @@
- AC_CONFIG_HEADERS([config.h])
- AC_CONFIG_SRCDIR([src/lapi.c])
-
--AM_INIT_AUTOMAKE([1.9 foreign])
-+AM_INIT_AUTOMAKE()
-
- AC_PROG_CC
- AC_PROG_LIBTOOL
|
[-]
[+]
|
Deleted |
lua51-5.1.1_pkgconfig_libdir.patch
^
|
@@ -1,13 +0,0 @@
-Index: etc/lua.pc.in
-===================================================================
---- etc/lua.pc.in.orig
-+++ etc/lua.pc.in
-@@ -1,7 +1,7 @@
- V= 5.1
- prefix= @prefix@
- exec_prefix=${prefix}
--libdir=${exec_prefix}/lib
-+libdir=@libdir@
- includedir=${prefix}/include
-
- Name: Lua
|
[-]
[+]
|
Added |
baselibs.conf
^
|
@@ -0,0 +1 @@
+liblua5_1
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/Makefile
^
|
@@ -7,28 +7,33 @@
# Your platform. See PLATS for possible values.
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.) 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).
-#
+# Where to install. The installation starts in the src and doc directories,
+# so take care if INSTALL_TOP is not an absolute path.
INSTALL_TOP= /usr/local
INSTALL_BIN= $(INSTALL_TOP)/bin
INSTALL_INC= $(INSTALL_TOP)/include
INSTALL_LIB= $(INSTALL_TOP)/lib
INSTALL_MAN= $(INSTALL_TOP)/man/man1
+#
+# You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with
+# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
-# How to install. If you don't have "install" (unlikely) then get install-sh at
-# http://dev.w3.org/cvsweb/libwww/config/install-sh
-# or use cp instead.
-INSTALL_EXEC= $(INSTALL) -p -m 0755
-INSTALL_DATA= $(INSTALL) -p -m 0644
+# How to install. If your install program does not support "-p", then you
+# may have to run ranlib on the installed liblua.a (do "make ranlib").
+INSTALL= install -p
+INSTALL_EXEC= $(INSTALL) -m 0755
+INSTALL_DATA= $(INSTALL) -m 0644
+#
+# If you don't have install you can use cp instead.
+# INSTALL= cp -p
+# INSTALL_EXEC= $(INSTALL)
+# INSTALL_DATA= $(INSTALL)
# Utilities.
-INSTALL= install
-MKDIR= mkdir
+MKDIR= mkdir -p
+RANLIB= ranlib
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
@@ -43,7 +48,7 @@
# Lua version and release.
V= 5.1
-R= 5.1.3
+R= 5.1.4
all: $(PLAT)
@@ -54,12 +59,15 @@
src/lua test/hello.lua
install: dummy
- cd src && $(MKDIR) -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+ cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+ranlib:
+ cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB)
+
local:
$(MAKE) install INSTALL_TOP=..
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/doc/manual.html
^
|
@@ -3,8 +3,8 @@
<head>
<title>Lua 5.1 Reference Manual</title>
-<link rel="stylesheet" href="lua.css">
-<link rel="stylesheet" href="manual.css">
+<link rel="stylesheet" type="text/css" href="lua.css">
+<link rel="stylesheet" type="text/css" href="manual.css">
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
</head>
@@ -33,7 +33,7 @@
<!-- ====================================================================== -->
<p>
-<!-- $Id: manual.of,v 1.45 2008/01/19 00:17:30 roberto Exp $ -->
+<!-- $Id: manual.of,v 1.48 2008/08/18 15:24:20 roberto Exp $ -->
@@ -103,7 +103,8 @@
Non-terminals are shown like non-terminal,
keywords are shown like <b>kword</b>,
and other terminal symbols are shown like `<b>=</b>´.
-The complete syntax of Lua can be found at the end of this manual.
+The complete syntax of Lua can be found in <a href="#8">§8</a>
+at the end of this manual.
@@ -139,7 +140,7 @@
<code>and</code> is a reserved word, but <code>And</code> and <code>AND</code>
are two different, valid names.
As a convention, names starting with an underscore followed by
-uppercase letters (such as <code>_VERSION</code>)
+uppercase letters (such as <a href="#pdf-_VERSION"><code>_VERSION</code></a>)
are reserved for internal global variables used by Lua.
@@ -169,27 +170,16 @@
and '<code>\'</code>' (apostrophe [single quote]).
Moreover, a backslash followed by a real newline
results in a newline in the string.
-A character in a string may also be specified by its numerical value
+A character in a string can also be specified by its numerical value
using the escape sequence <code>\<em>ddd</em></code>,
where <em>ddd</em> is a sequence of up to three decimal digits.
(Note that if a numerical escape is to be followed by a digit,
it must be expressed using exactly three digits.)
-Strings in Lua may contain any 8-bit value, including embedded zeros,
+Strings in Lua can contain any 8-bit value, including embedded zeros,
which can be specified as '<code>\0</code>'.
<p>
-To put a double (single) quote, a newline, a backslash,
-a carriage return,
-or an embedded zero
-inside a literal string enclosed by double (single) quotes
-you must use an escape sequence.
-Any other character may be directly inserted into the literal.
-(Some control characters may cause problems for the file system,
-but Lua has no problem with them.)
-
-
-<p>
Literal strings can also be defined using a long format
enclosed by <em>long brackets</em>.
We define an <em>opening long bracket of level <em>n</em></em> as an opening
@@ -202,10 +192,10 @@
for instance, a closing long bracket of level 4 is written as <code>]====]</code>.
A long string starts with an opening long bracket of any level and
ends at the first closing long bracket of the same level.
-Literals in this bracketed form may run for several lines,
+Literals in this bracketed form can run for several lines,
do not interpret any escape sequences,
and ignore long brackets of any other level.
-They may contain anything except a closing bracket of the proper level.
+They can contain anything except a closing bracket of the proper level.
<p>
@@ -215,7 +205,7 @@
As an example, in a system using ASCII
(in which '<code>a</code>' is coded as 97,
newline is coded as 10, and '<code>1</code>' is coded as 49),
-the five literals below denote the same string:
+the five literal strings below denote the same string:
<pre>
a = 'alo\n123"'
@@ -229,7 +219,7 @@
</pre>
<p>
-A <em>numerical constant</em> may be written with an optional decimal part
+A <em>numerical constant</em> can be written with an optional decimal part
and an optional decimal exponent.
Lua also accepts integer hexadecimal constants,
by prefixing them with <code>0x</code>.
@@ -288,7 +278,7 @@
<em>String</em> represents arrays of characters.
Lua is 8-bit clean:
-strings may contain any 8-bit character,
+strings can contain any 8-bit character,
including embedded zeros ('<code>\0</code>') (see <a href="#2.1">§2.1</a>).
@@ -327,7 +317,7 @@
Tables can be <em>heterogeneous</em>;
that is, they can contain values of all types (except <b>nil</b>).
Tables are the sole data structuring mechanism in Lua;
-they may be used to represent ordinary arrays,
+they can be used to represent ordinary arrays,
symbol tables, sets, records, graphs, trees, etc.
To represent records, Lua uses the field name as an index.
The language supports this representation by
@@ -341,8 +331,8 @@
the value of a table field can be of any type (except <b>nil</b>).
In particular,
because functions are first-class values,
-table fields may contain functions.
-Thus tables may also carry <em>methods</em> (see <a href="#2.5.9">§2.5.9</a>).
+table fields can contain functions.
+Thus tables can also carry <em>methods</em> (see <a href="#2.5.9">§2.5.9</a>).
<p>
@@ -477,7 +467,7 @@
Lua supports an almost conventional set of statements,
similar to those in Pascal or C.
This set includes
-assignment, control structures, function calls,
+assignments, control structures, function calls,
and variable declarations.
@@ -505,15 +495,15 @@
<p>
-A chunk may be stored in a file or in a string inside the host program.
-When a chunk is executed, first it is pre-compiled into instructions for
-a virtual machine,
-and then the compiled code is executed
-by an interpreter for the virtual machine.
+A chunk can be stored in a file or in a string inside the host program.
+To execute a chunk,
+Lua first pre-compiles the chunk into instructions for a virtual machine,
+and then it executes the compiled code
+with an interpreter for the virtual machine.
<p>
-Chunks may also be pre-compiled into binary form;
+Chunks can also be pre-compiled into binary form;
see program <code>luac</code> for details.
Programs in source and compiled forms are interchangeable;
Lua automatically detects the file type and acts accordingly.
@@ -532,7 +522,7 @@
</pre>
<p>
-A block may be explicitly delimited to produce a single statement:
+A block can be explicitly delimited to produce a single statement:
<pre>
stat ::= <b>do</b> block <b>end</b>
@@ -550,7 +540,7 @@
<h3>2.4.3 - <a name="2.4.3">Assignment</a></h3>
<p>
-Lua allows multiple assignment.
+Lua allows multiple assignments.
Therefore, the syntax for assignment
defines a list of variables on the left side
and a list of expressions on the right side.
@@ -573,7 +563,7 @@
If there are fewer values than needed,
the list is extended with as many <b>nil</b>'s as needed.
If the list of expressions ends with a function call,
-then all values returned by this call enter in the list of values,
+then all values returned by that call enter the list of values,
before the adjustment
(except when the call is enclosed in parentheses; see <a href="#2.5">§2.5</a>).
@@ -595,7 +585,13 @@
<pre>
x, y = y, x
</pre><p>
-exchanges the values of <code>x</code> and <code>y</code>.
+exchanges the values of <code>x</code> and <code>y</code>,
+and
+
+<pre>
+ x, y, z = y, z, x
+</pre><p>
+cyclically permutes the values of <code>x</code>, <code>y</code>, and <code>z</code>.
<p>
@@ -644,7 +640,7 @@
<p>
The condition expression of a
-control structure may return any value.
+control structure can return any value.
Both <b>false</b> and <b>nil</b> are considered false.
All values different from <b>nil</b> and <b>false</b> are considered true
(in particular, the number 0 and the empty string are also true).
@@ -662,8 +658,8 @@
The <b>return</b> statement is used to return values
from a function or a chunk (which is just a function).
-Functions and chunks may return more than one value,
-so the syntax for the <b>return</b> statement is
+Functions and chunks can return more than one value,
+and so the syntax for the <b>return</b> statement is
<pre>
stat ::= <b>return</b> [explist]
@@ -745,7 +741,7 @@
<li>
<code><em>var</em></code>, <code><em>limit</em></code>, and <code><em>step</em></code> are invisible variables.
-The names are here for explanatory purposes only.
+The names shown here are for explanatory purposes only.
</li>
<li>
@@ -842,8 +838,8 @@
<h3>2.4.7 - <a name="2.4.7">Local Declarations</a></h3><p>
-Local variables may be declared anywhere inside a block.
-The declaration may include an initial assignment:
+Local variables can be declared anywhere inside a block.
+The declaration can include an initial assignment:
<pre>
stat ::= <b>local</b> namelist [`<b>=</b>´ explist]
@@ -908,12 +904,12 @@
<p>
-Both function calls and vararg expressions may result in multiple values.
-If the expression is used as a statement (see <a href="#2.4.6">§2.4.6</a>)
-(only possible for function calls),
+Both function calls and vararg expressions can result in multiple values.
+If an expression is used as a statement
+(only possible for function calls (see <a href="#2.4.6">§2.4.6</a>)),
then its return list is adjusted to zero elements,
thus discarding all returned values.
-If the expression is used as the last (or the only) element
+If an expression is used as the last (or the only) element
of a list of expressions,
then no adjustment is made
(unless the call is enclosed in parentheses).
@@ -931,7 +927,7 @@
g(x, f()) -- g gets x plus all results from f()
a,b,c = f(), x -- f() is adjusted to 1 result (c gets nil)
a,b = ... -- a gets the first vararg parameter, b gets
- -- the second (both a and b may get nil if there
+ -- the second (both a and b can get nil if there
-- is no corresponding vararg parameter)
a,b,c = x, f() -- f() is adjusted to 2 results
@@ -945,7 +941,7 @@
</pre>
<p>
-An expression enclosed in parentheses always results in only one value.
+Any expression enclosed in parentheses always results in only one value.
Thus,
<code>(f(x,y,z))</code> is always a single value,
even if <code>f</code> returns several values.
@@ -1023,6 +1019,8 @@
then their values are compared according to the current locale.
Otherwise, Lua tries to call the "lt" or the "le"
metamethod (see <a href="#2.8">§2.8</a>).
+A comparison <code>a > b</code> is translated to <code>b < a</code>
+and <code>a >= b</code> is translated to <code>b <= a</code>.
@@ -1060,7 +1058,7 @@
10 and 20 --> 20
</pre><p>
(In this manual,
---> indicates the result of the preceding expression.)
+<code>--></code> indicates the result of the preceding expression.)
@@ -1090,13 +1088,13 @@
The length of a table <code>t</code> is defined to be any
integer index <code>n</code>
such that <code>t[n]</code> is not <b>nil</b> and <code>t[n+1]</code> is <b>nil</b>;
-moreover, if <code>t[1]</code> is <b>nil</b>, <code>n</code> may be zero.
+moreover, if <code>t[1]</code> is <b>nil</b>, <code>n</code> can be zero.
For a regular array, with non-nil values from 1 to a given <code>n</code>,
its length is exactly that <code>n</code>,
the index of its last value.
If the array has "holes"
(that is, <b>nil</b> values between other non-nil values),
-then <code>#t</code> may be any of the indices that
+then <code>#t</code> can be any of the indices that
directly precedes a <b>nil</b> value
(that is, it may consider any such <b>nil</b> value as the end of
the array).
@@ -1132,7 +1130,7 @@
<h3>2.5.7 - <a name="2.5.7">Table Constructors</a></h3><p>
Table constructors are expressions that create tables.
Every time a constructor is evaluated, a new table is created.
-Constructors can be used to create empty tables,
+A constructor can be used to create an empty table
or to create a table and initialize some of its fields.
The general syntax for constructors is
@@ -1179,12 +1177,12 @@
then all values returned by this expression enter the list consecutively
(see <a href="#2.5.8">§2.5.8</a>).
To avoid this,
-enclose the function call (or the vararg expression)
+enclose the function call or the vararg expression
in parentheses (see <a href="#2.5">§2.5</a>).
<p>
-The field list may have an optional trailing separator,
+The field list can have an optional trailing separator,
as a convenience for machine-generated code.
@@ -1349,8 +1347,8 @@
This function instance (or <em>closure</em>)
is the final value of the expression.
Different instances of the same function
-may refer to different external local variables
-and may have different environment tables.
+can refer to different external local variables
+and can have different environment tables.
<p>
@@ -1377,7 +1375,7 @@
then its return list is adjusted to one element.
If the expression is used as the last element of a list of expressions,
then no adjustment is made
-(unless the call is enclosed in parentheses).
+(unless that last expression is enclosed in parentheses).
<p>
@@ -1520,7 +1518,7 @@
<h2>2.8 - <a name="2.8">Metatables</a></h2>
<p>
-Every value in Lua may have a <em>metatable</em>.
+Every value in Lua can have a <em>metatable</em>.
This <em>metatable</em> is an ordinary Lua table
that defines the behavior of the original value
under certain special operations.
@@ -1549,22 +1547,22 @@
through the <a href="#pdf-setmetatable"><code>setmetatable</code></a>
function.
You cannot change the metatable of other types from Lua
-(except using the debug library);
+(except by using the debug library);
you must use the C API for that.
<p>
Tables and full userdata have individual metatables
-(although multiple tables and userdata can share their metatables);
-values of all other types share one single metatable per type.
-So, there is one single metatable for all numbers,
+(although multiple tables and userdata can share their metatables).
+Values of all other types share one single metatable per type;
+that is, there is one single metatable for all numbers,
one for all strings, etc.
<p>
-A metatable may control how an object behaves in arithmetic operations,
+A metatable controls how an object behaves in arithmetic operations,
order comparisons, concatenation, length operation, and indexing.
-A metatable can also define a function to be called when a userdata
+A metatable also can define a function to be called when a userdata
is garbage collected.
For each of these operations Lua associates a specific key
called an <em>event</em>.
@@ -1806,7 +1804,7 @@
if h then
return (h(op1, op2))
else
- error(···);
+ error(···)
end
end
end
@@ -1833,7 +1831,7 @@
if h then
return not h(op2, op1)
else
- error(···);
+ error(···)
end
end
end
@@ -1860,7 +1858,7 @@
else
h = metatable(table).__index
if h == nil then
- error(···);
+ error(···)
end
end
if type(h) == "function" then
@@ -1886,7 +1884,7 @@
else
h = metatable(table).__newindex
if h == nil then
- error(···);
+ error(···)
end
end
if type(h) == "function" then
@@ -1934,6 +1932,17 @@
<p>
+Threads are created sharing the environment of the creating thread.
+Userdata and C functions are created sharing the environment
+of the creating C function.
+Non-nested Lua functions
+(created by <a href="#pdf-loadfile"><code>loadfile</code></a>, <a href="#pdf-loadstring"><code>loadstring</code></a> or <a href="#pdf-load"><code>load</code></a>)
+are created sharing the environment of the creating thread.
+Nested Lua functions are created sharing the environment of
+the creating Lua function.
+
+
+<p>
Environments associated with userdata have no meaning for Lua.
It is only a convenience feature for programmers to associate a table to
a userdata.
@@ -1942,23 +1951,22 @@
<p>
Environments associated with threads are called
<em>global environments</em>.
-They are used as the default environment for their threads and
-non-nested functions created by the thread
-(through <a href="#pdf-loadfile"><code>loadfile</code></a>, <a href="#pdf-loadstring"><code>loadstring</code></a> or <a href="#pdf-load"><code>load</code></a>)
+They are used as the default environment for threads and
+non-nested Lua functions created by the thread
and can be directly accessed by C code (see <a href="#3.3">§3.3</a>).
<p>
-Environments associated with C functions can be directly
+The environment associated with a C function can be directly
accessed by C code (see <a href="#3.3">§3.3</a>).
-They are used as the default environment for other C functions
-created by the function.
+It is used as the default environment for other C functions
+and userdata created by the function.
<p>
Environments associated with Lua functions are used to resolve
all accesses to global variables within the function (see <a href="#2.3">§2.3</a>).
-They are used as the default environment for other Lua functions
+They are used as the default environment for nested Lua functions
created by the function.
@@ -1985,9 +1993,9 @@
Lua manages memory automatically by running
a <em>garbage collector</em> from time to time
to collect all <em>dead objects</em>
-(that is, these objects that are no longer accessible from Lua).
-All objects in Lua are subject to automatic management:
-tables, userdata, functions, threads, and strings.
+(that is, objects that are no longer accessible from Lua).
+All memory used by Lua is subject to automatic management:
+tables, userdata, functions, threads, strings, etc.
<p>
@@ -1995,15 +2003,17 @@
It uses two numbers to control its garbage-collection cycles:
the <em>garbage-collector pause</em> and
the <em>garbage-collector step multiplier</em>.
+Both use percentage points as units
+(so that a value of 100 means an internal value of 1).
<p>
The garbage-collector pause
controls how long the collector waits before starting a new cycle.
Larger values make the collector less aggressive.
-Values smaller than 1 mean the collector will not wait to
+Values smaller than 100 mean the collector will not wait to
start a new cycle.
-A value of 2 means that the collector waits for the total memory in use
+A value of 200 means that the collector waits for the total memory in use
to double before starting a new cycle.
@@ -2013,17 +2023,15 @@
memory allocation.
Larger values make the collector more aggressive but also increase
the size of each incremental step.
-Values smaller than 1 make the collector too slow and
-may result in the collector never finishing a cycle.
-The default, 2, means that the collector runs at "twice"
+Values smaller than 100 make the collector too slow and
+can result in the collector never finishing a cycle.
+The default, 200, means that the collector runs at "twice"
the speed of memory allocation.
<p>
You can change these numbers by calling <a href="#lua_gc"><code>lua_gc</code></a> in C
or <a href="#pdf-collectgarbage"><code>collectgarbage</code></a> in Lua.
-Both get percentage points as arguments
-(so an argument of 100 means a real value of 1).
With these functions you can also control
the collector directly (e.g., stop and restart it).
@@ -2100,7 +2108,7 @@
<p>
After you use a table as a metatable,
-you should not change the value of its field <code>__mode</code>.
+you should not change the value of its <code>__mode</code> field.
Otherwise, the weak behavior of the tables controlled by this
metatable is undefined.
@@ -2133,7 +2141,7 @@
<p>
When you first call <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a>,
passing as its first argument
-the thread returned by <a href="#pdf-coroutine.create"><code>coroutine.create</code></a>,
+a thread returned by <a href="#pdf-coroutine.create"><code>coroutine.create</code></a>,
the coroutine starts its execution,
at the first line of its main function.
Extra arguments passed to <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a> are passed on
@@ -2383,7 +2391,7 @@
<code>lua_upvalueindex(1)</code>, and so on.
Any access to <code>lua_upvalueindex(<em>n</em>)</code>,
where <em>n</em> is greater than the number of upvalues of the
-current function,
+current function (but not greater than 256),
produces an acceptable (but invalid) index.
@@ -2431,7 +2439,7 @@
<p>
-Most functions in the API may throw an error,
+Most functions in the API can throw an error,
for instance due to a memory allocation error.
The documentation for each function indicates whether
it can throw errors.
@@ -2459,7 +2467,7 @@
The second field, <code>p</code>,
is how many elements the function pushes onto the stack.
(Any function always pushes its results after popping its arguments.)
-A field in the form <code>x|y</code> means the function may push (or pop)
+A field in the form <code>x|y</code> means the function can push (or pop)
<code>x</code> or <code>y</code> elements,
depending on the situation;
an interrogation mark '<code>?</code>' means that
@@ -2544,7 +2552,7 @@
Lua calls a <em>panic function</em>
and then calls <code>exit(EXIT_FAILURE)</code>,
thus exiting the host application.
-Your panic function may avoid this exit by
+Your panic function can avoid this exit by
never returning (e.g., doing a long jump).
@@ -2589,7 +2597,7 @@
<p>
-The following example shows how the host program may do the
+The following example shows how the host program can do the
equivalent to this Lua code:
<pre>
@@ -2858,13 +2866,13 @@
</li>
<li><b><code>LUA_GCSETPAUSE</code>:</b>
-sets <code>data</code>/100 as the new value
+sets <code>data</code> as the new value
for the <em>pause</em> of the collector (see <a href="#2.10">§2.10</a>).
The function returns the previous value of the pause.
</li>
<li><b><code>LUA_GCSETSTEPMUL</code>:</b>
-sets <code>data</code>/100 as the new value for the <em>step multiplier</em> of
+sets <code>data</code> as the new value for the <em>step multiplier</em> of
the collector (see <a href="#2.10">§2.10</a>).
The function returns the previous value of the step multiplier.
</li>
@@ -3485,6 +3493,10 @@
<a href="#lua_pushcclosure"><code>lua_pushcclosure</code></a> also pops these values from the stack.
+<p>
+The maximum value for <code>n</code> is 255.
+
+
@@ -3774,7 +3786,8 @@
with a new piece of the chunk
and set <code>size</code> to the block size.
The block must exist until the reader function is called again.
-To signal the end of the chunk, the reader must return <code>NULL</code>.
+To signal the end of the chunk,
+the reader must return <code>NULL</code> or set <code>size</code> to zero.
The reader function may return pieces of any size greater than zero.
@@ -4081,7 +4094,7 @@
to a string inside the Lua state.
This string always has a zero ('<code>\0</code>')
after its last character (as in C),
-but may contain other zeros in its body.
+but can contain other zeros in its body.
Because Lua has garbage collection,
there is no guarantee that the pointer returned by <a href="#lua_tolstring"><code>lua_tolstring</code></a>
will be valid after the corresponding value is removed from the stack.
@@ -4112,7 +4125,7 @@
<p>
Converts the value at the given acceptable index to a generic
C pointer (<code>void*</code>).
-The value may be a userdata, a table, a thread, or a function;
+The value can be a userdata, a table, a thread, or a function;
otherwise, <a href="#lua_topointer"><code>lua_topointer</code></a> returns <code>NULL</code>.
Different objects will give different pointers.
There is no way to convert the pointer back to its original value.
@@ -4350,8 +4363,8 @@
a reasonable name for the given function.
Because functions in Lua are first-class values,
they do not have a fixed name:
-some functions may be the value of multiple global variables,
-while others may be stored only in a table field.
+some functions can be the value of multiple global variables,
+while others can be stored only in a table field.
The <code>lua_getinfo</code> function checks how the function was
called to find a suitable name.
If it cannot find a name,
@@ -4581,7 +4594,7 @@
Moreover, for line events, the field <code>currentline</code> is also set.
To get the value of any other field in <code>ar</code>,
the hook must call <a href="#lua_getinfo"><code>lua_getinfo</code></a>.
-For return events, <code>event</code> may be <code>LUA_HOOKRET</code>,
+For return events, <code>event</code> can be <code>LUA_HOOKRET</code>,
the normal value, or <code>LUA_HOOKTAILRET</code>.
In the latter case, Lua is simulating a return from
a function that did a tail call;
@@ -5632,7 +5645,7 @@
<ul>
-<li>basic library;</li>
+<li>basic library,</li> which includes the coroutine sub-library;
<li>package library;</li>
@@ -5731,13 +5744,15 @@
</li>
<li><b>"setpause":</b>
-sets <code>arg</code>/100 as the new value for the <em>pause</em> of
+sets <code>arg</code> as the new value for the <em>pause</em> of
the collector (see <a href="#2.10">§2.10</a>).
+Returns the previous value for <em>pause</em>.
</li>
<li><b>"setstepmul":</b>
-sets <code>arg</code>/100 as the new value for the <em>step multiplier</em> of
+sets <code>arg</code> as the new value for the <em>step multiplier</em> of
the collector (see <a href="#2.10">§2.10</a>).
+Returns the previous value for <em>step</em>.
</li>
</ul>
@@ -5842,7 +5857,7 @@
Loads a chunk using function <code>func</code> to get its pieces.
Each call to <code>func</code> must return a string that concatenates
with previous results.
-A return of <b>nil</b> (or no value) signals the end of the chunk.
+A return of an empty string, <b>nil</b>, or no value signals the end of the chunk.
<p>
@@ -6088,7 +6103,7 @@
In bases above 10, the letter '<code>A</code>' (in either upper or lower case)
represents 10, '<code>B</code>' represents 11, and so forth,
with '<code>Z</code>' representing 35.
-In base 10 (the default), the number may have a decimal part,
+In base 10 (the default), the number can have a decimal part,
as well as an optional exponent part (see <a href="#2.1">§2.1</a>).
In other bases, only unsigned integers are accepted.
@@ -6335,7 +6350,7 @@
<p>
-This function may receive optional <em>options</em> after
+This function can receive optional <em>options</em> after
the module name,
where each option is a function to be applied over the module.
@@ -6442,7 +6457,7 @@
<a href="#pdf-require"><code>require</code></a> calls each of these searchers in ascending order,
with the module name (the argument given to <a href="#pdf-require"><code>require</code></a>) as its
sole parameter.
-The function may return another function (the module <em>loader</em>)
+The function can return another function (the module <em>loader</em>)
or a string explaining why it did not find that module
(or <b>nil</b> if it has nothing to say).
Lua initializes this table with four functions.
@@ -6618,6 +6633,10 @@
<p>
+The string library assumes one-byte character encodings.
+
+
+<p>
<hr><h3><a name="pdf-string.byte"><code>string.byte (s [, i [, j]])</code></a></h3>
Returns the internal numerical codes of the characters <code>s[i]</code>,
<code>s[i+1]</code>, ···, <code>s[j]</code>.
@@ -6667,7 +6686,7 @@
otherwise, it returns <b>nil</b>.
A third, optional numerical argument <code>init</code> specifies
where to start the search;
-its default value is 1 and may be negative.
+its default value is 1 and can be negative.
A value of <b>true</b> as a fourth, optional argument <code>plain</code>
turns off the pattern matching facilities,
so the function does a plain "find substring" operation,
@@ -6771,7 +6790,7 @@
in which all (or the first <code>n</code>, if given)
occurrences of the <code>pattern</code> have been
replaced by a replacement string specified by <code>repl</code>,
-which may be a string, a table, or a function.
+which can be a string, a table, or a function.
<code>gsub</code> also returns, as its second value,
the total number of matches that occurred.
@@ -6869,7 +6888,7 @@
then the whole match is returned.
A third, optional numerical argument <code>init</code> specifies
where to start the search;
-its default value is 1 and may be negative.
+its default value is 1 and can be negative.
@@ -6893,7 +6912,7 @@
<hr><h3><a name="pdf-string.sub"><code>string.sub (s, i [, j])</code></a></h3>
Returns the substring of <code>s</code> that
starts at <code>i</code> and continues until <code>j</code>;
-<code>i</code> and <code>j</code> may be negative.
+<code>i</code> and <code>j</code> can be negative.
If <code>j</code> is absent, then it is assumed to be equal to -1
(which is the same as the string length).
In particular,
@@ -6962,9 +6981,9 @@
<li><b><code>[<em>set</em>]</code>:</b>
represents the class which is the union of all
characters in <em>set</em>.
-A range of characters may be specified by
+A range of characters can be specified by
separating the end characters of the range with a '<code>-</code>'.
-All classes <code>%</code><em>x</em> described above may also be used as
+All classes <code>%</code><em>x</em> described above can also be used as
components in <em>set</em>.
All other characters in <em>set</em> represent themselves.
For example, <code>[%w_]</code> (or <code>[_%w]</code>)
@@ -7001,7 +7020,7 @@
<h4>Pattern Item:</h4><p>
-A <em>pattern item</em> may be
+A <em>pattern item</em> can be
<ul>
@@ -7070,7 +7089,7 @@
<h4>Captures:</h4><p>
-A pattern may contain sub-patterns enclosed in parentheses;
+A pattern can contain sub-patterns enclosed in parentheses;
they describe <em>captures</em>.
When a match succeeds, the substrings of the subject string
that match captures are stored (<em>captured</em>) for future use.
@@ -7320,7 +7339,8 @@
<p>
-Returns the remainder of the division of <code>x</code> by <code>y</code>.
+Returns the remainder of the division of <code>x</code> by <code>y</code>
+that rounds the quotient towards zero.
@@ -7657,7 +7677,7 @@
<li><b>"a+":</b> append update mode, previous data is preserved,
writing is only allowed at the end of file.</li>
</ul><p>
-The <code>mode</code> string may also have a '<code>b</code>' at the end,
+The <code>mode</code> string can also have a '<code>b</code>' at the end,
which is needed in some systems to open the file in binary mode.
This string is exactly what is used in the
standard C function <code>fopen</code>.
@@ -8115,6 +8135,22 @@
and explicitly removed when no longer needed.
+<p>
+On some systems (POSIX),
+this function also creates a file with that name,
+to avoid security risks.
+(Someone else might create the file with wrong permissions
+in the time between getting the name and creating the file.)
+You still have to open the file to use it
+and to remove it (even if you do not use it).
+
+
+<p>
+When possible,
+you may prefer to use <a href="#pdf-io.tmpfile"><code>io.tmpfile</code></a>,
+which automatically removes the file when the program ends.
+
+
@@ -8207,7 +8243,7 @@
<p>
-The returned table may contain all the fields returned by <a href="#lua_getinfo"><code>lua_getinfo</code></a>,
+The returned table can contain all the fields returned by <a href="#lua_getinfo"><code>lua_getinfo</code></a>,
with the string <code>what</code> describing which fields to fill in.
The default for <code>what</code> is to get all information available,
except the table of valid lines.
@@ -8326,7 +8362,8 @@
<p>
When the hook is called, its first parameter is a string
describing the event that has triggered its call:
-<code>"call"</code>, <code>"return"</code> (or <code>"tail return"</code>),
+<code>"call"</code>, <code>"return"</code> (or <code>"tail return"</code>,
+when simulating a return from a tail call),
<code>"line"</code>, and <code>"count"</code>.
For line events,
the hook also gets the new line number as its second parameter.
@@ -8754,10 +8791,10 @@
<HR>
<SMALL>
Last update:
-Fri Jan 18 22:32:24 BRST 2008
+Mon Aug 18 13:25:46 BRT 2008
</SMALL>
<!--
-Last change: revised for Lua 5.1.3
+Last change: revised for Lua 5.1.4
-->
</body></html>
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/doc/readme.html
^
|
@@ -12,7 +12,7 @@
Documentation
</H1>
-This is the documentation included in the source distribution of Lua 5.1.3.
+This is the documentation included in the source distribution of Lua 5.1.4.
<UL>
<LI><A HREF="contents.html">Reference manual</A>
@@ -33,7 +33,7 @@
<HR>
<SMALL>
Last update:
-Wed Dec 19 13:59:14 BRST 2007
+Tue Aug 12 14:46:07 BRT 2008
</SMALL>
</BODY>
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/etc/lua.pc
^
|
@@ -5,7 +5,7 @@
# grep '^V=' ../Makefile
V= 5.1
# grep '^R=' ../Makefile
-R= 5.1.3
+R= 5.1.4
# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
prefix= /usr/local
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/src/lapi.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lapi.c,v 2.55.1.3 2008/01/03 15:20:39 roberto Exp $
+** $Id: lapi.c,v 2.55.1.5 2008/07/04 18:41:18 roberto Exp $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -93,15 +93,14 @@
LUA_API int lua_checkstack (lua_State *L, int size) {
- int res;
+ int res = 1;
lua_lock(L);
- if ((L->top - L->base + size) > LUAI_MAXCSTACK)
+ if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK)
res = 0; /* stack overflow */
- else {
+ else if (size > 0) {
luaD_checkstack(L, size);
if (L->ci->top < L->top + size)
L->ci->top = L->top + size;
- res = 1;
}
lua_unlock(L);
return res;
@@ -930,10 +929,13 @@
g->GCthreshold = g->totalbytes - a;
else
g->GCthreshold = 0;
- while (g->GCthreshold <= g->totalbytes)
+ while (g->GCthreshold <= g->totalbytes) {
luaC_step(L);
- if (g->gcstate == GCSpause) /* end of cycle? */
- res = 1; /* signal it */
+ if (g->gcstate == GCSpause) { /* end of cycle? */
+ res = 1; /* signal it */
+ break;
+ }
+ }
break;
}
case LUA_GCSETPAUSE: {
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/src/lbaselib.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lbaselib.c,v 1.191.1.4 2008/01/20 13:53:22 roberto Exp $
+** $Id: lbaselib.c,v 1.191.1.6 2008/02/14 16:46:22 roberto Exp $
** Basic library
** See Copyright Notice in lua.h
*/
@@ -344,10 +344,12 @@
luaL_checktype(L, 1, LUA_TTABLE);
i = luaL_optint(L, 2, 1);
e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1));
+ if (i > e) return 0; /* empty range */
n = e - i + 1; /* number of elements */
- if (n <= 0) return 0; /* empty range */
- luaL_checkstack(L, n, "table too big to unpack");
- for (; i<=e; i++) /* push arg[i...e] */
+ if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */
+ return luaL_error(L, "too many results to unpack");
+ lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */
+ while (i++ < e) /* push arg[i + 1...e] */
lua_rawgeti(L, 1, i);
return n;
}
@@ -526,7 +528,7 @@
status = lua_resume(co, narg);
if (status == 0 || status == LUA_YIELD) {
int nres = lua_gettop(co);
- if (!lua_checkstack(L, nres))
+ if (!lua_checkstack(L, nres + 1))
luaL_error(L, "too many results to resume");
lua_xmove(co, L, nres); /* move yielded values */
return nres;
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/src/ldebug.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: ldebug.c,v 2.29.1.3 2007/12/28 15:32:23 roberto Exp $
+** $Id: ldebug.c,v 2.29.1.6 2008/05/08 16:56:26 roberto Exp $
** Debug Interface
** See Copyright Notice in lua.h
*/
@@ -275,12 +275,12 @@
static int precheck (const Proto *pt) {
check(pt->maxstacksize <= MAXSTACK);
- lua_assert(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize);
- lua_assert(!(pt->is_vararg & VARARG_NEEDSARG) ||
+ check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize);
+ check(!(pt->is_vararg & VARARG_NEEDSARG) ||
(pt->is_vararg & VARARG_HASARG));
check(pt->sizeupvalues <= pt->nups);
check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0);
- check(GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN);
+ check(pt->sizecode > 0 && GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN);
return 1;
}
@@ -346,9 +346,18 @@
int dest = pc+1+b;
check(0 <= dest && dest < pt->sizecode);
if (dest > 0) {
- /* cannot jump to a setlist count */
- Instruction d = pt->code[dest-1];
- check(!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0));
+ int j;
+ /* check that it does not jump to a setlist count; this
+ is tricky, because the count from a previous setlist may
+ have the same value of an invalid setlist; so, we must
+ go all the way back to the first of them (if any) */
+ for (j = 0; j < dest; j++) {
+ Instruction d = pt->code[dest-1-j];
+ if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break;
+ }
+ /* if 'j' is even, previous value is not a setlist (even if
+ it looks like one) */
+ check((j&1) == 0);
}
}
break;
@@ -363,7 +372,11 @@
}
switch (op) {
case OP_LOADBOOL: {
- check(c == 0 || pc+2 < pt->sizecode); /* check its jump */
+ if (c == 1) { /* does it jump? */
+ check(pc+2 < pt->sizecode); /* check its jump */
+ check(GET_OPCODE(pt->code[pc+1]) != OP_SETLIST ||
+ GETARG_C(pt->code[pc+1]) != 0);
+ }
break;
}
case OP_LOADNIL: {
@@ -428,7 +441,10 @@
}
case OP_SETLIST: {
if (b > 0) checkreg(pt, a + b);
- if (c == 0) pc++;
+ if (c == 0) {
+ pc++;
+ check(pc < pt->sizecode - 1);
+ }
break;
}
case OP_CLOSURE: {
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/src/loadlib.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: loadlib.c,v 1.52.1.2 2007/12/28 14:58:43 roberto Exp $
+** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $
** Dynamic library loader for Lua
** See Copyright Notice in lua.h
**
@@ -506,8 +506,10 @@
static void setfenv (lua_State *L) {
lua_Debug ar;
- lua_getstack(L, 1, &ar);
- lua_getinfo(L, "f", &ar);
+ if (lua_getstack(L, 1, &ar) == 0 ||
+ lua_getinfo(L, "f", &ar) == 0 || /* get calling function */
+ lua_iscfunction(L, -1))
+ luaL_error(L, LUA_QL("module") " not called from a Lua function");
lua_pushvalue(L, -2);
lua_setfenv(L, -2);
lua_pop(L, 1);
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/src/lobject.h
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lobject.h,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
+** $Id: lobject.h,v 2.20.1.2 2008/08/06 13:29:48 roberto Exp $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
@@ -208,7 +208,7 @@
#define getstr(ts) cast(const char *, (ts) + 1)
-#define svalue(o) getstr(tsvalue(o))
+#define svalue(o) getstr(rawtsvalue(o))
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/src/lstrlib.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lstrlib.c,v 1.132.1.3 2007/12/28 15:32:23 roberto Exp $
+** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -35,7 +35,8 @@
static ptrdiff_t posrelat (ptrdiff_t pos, size_t len) {
/* relative string position: negative means back from end */
- return (pos>=0) ? pos : (ptrdiff_t)len+pos+1;
+ if (pos < 0) pos += (ptrdiff_t)len + 1;
+ return (pos >= 0) ? pos : 0;
}
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/src/ltablib.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: ltablib.c,v 1.38.1.2 2007/12/28 15:32:23 roberto Exp $
+** $Id: ltablib.c,v 1.38.1.3 2008/02/14 16:46:58 roberto Exp $
** Library for Table Manipulation
** See Copyright Notice in lua.h
*/
@@ -132,6 +132,15 @@
}
+static void addfield (lua_State *L, luaL_Buffer *b, int i) {
+ lua_rawgeti(L, 1, i);
+ if (!lua_isstring(L, -1))
+ luaL_error(L, "invalid value (%s) at index %d in table for "
+ LUA_QL("concat"), luaL_typename(L, -1), i);
+ luaL_addvalue(b);
+}
+
+
static int tconcat (lua_State *L) {
luaL_Buffer b;
size_t lsep;
@@ -141,13 +150,12 @@
i = luaL_optint(L, 3, 1);
last = luaL_opt(L, luaL_checkint, 4, luaL_getn(L, 1));
luaL_buffinit(L, &b);
- for (; i <= last; i++) {
- lua_rawgeti(L, 1, i);
- luaL_argcheck(L, lua_isstring(L, -1), 1, "table contains non-strings");
- luaL_addvalue(&b);
- if (i != last)
- luaL_addlstring(&b, sep, lsep);
+ for (; i < last; i++) {
+ addfield(L, &b, i);
+ luaL_addlstring(&b, sep, lsep);
}
+ if (i == last) /* add last value (if interval was not empty) */
+ addfield(L, &b, i);
luaL_pushresult(&b);
return 1;
}
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/src/lua.h
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lua.h,v 1.218.1.4 2008/01/03 15:41:15 roberto Exp $
+** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $
** Lua - An Extensible Extension Language
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
** See Copyright Notice at the end of this file
@@ -17,7 +17,7 @@
#define LUA_VERSION "Lua 5.1"
-#define LUA_RELEASE "Lua 5.1.3"
+#define LUA_RELEASE "Lua 5.1.4"
#define LUA_VERSION_NUM 501
#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/src/luaconf.h
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: luaconf.h,v 1.82.1.6 2008/01/18 17:07:48 roberto Exp $
+** $Id: luaconf.h,v 1.82.1.7 2008/02/11 16:25:08 roberto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -440,10 +440,10 @@
@* can use.
** CHANGE it if you need lots of (Lua) stack space for your C
** functions. This limit is arbitrary; its only purpose is to stop C
-** functions to consume unlimited stack space.
+** functions to consume unlimited stack space. (must be smaller than
+** -LUA_REGISTRYINDEX)
*/
-#define LUAI_MCS_AUX ((int)(INT_MAX / (4*sizeof(LUA_NUMBER))))
-#define LUAI_MAXCSTACK (LUAI_MCS_AUX > SHRT_MAX ? SHRT_MAX : LUAI_MCS_AUX)
+#define LUAI_MAXCSTACK 8000
|
[-]
[+]
|
Changed |
lua-5.1.4.tar.bz2/src/lundump.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lundump.c,v 2.7.1.2 2008/01/18 16:39:11 roberto Exp $
+** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $
** load precompiled Lua chunks
** See Copyright Notice in lua.h
*/
@@ -48,7 +48,6 @@
static void LoadBlock(LoadState* S, void* b, size_t size)
{
size_t r=luaZ_read(S->Z,b,size);
- UNUSED(r);
IF (r!=0, "unexpected end");
}
@@ -115,7 +114,7 @@
setnilvalue(o);
break;
case LUA_TBOOLEAN:
- setbvalue(o,LoadChar(S));
+ setbvalue(o,LoadChar(S)!=0);
break;
case LUA_TNUMBER:
setnvalue(o,LoadNumber(S));
@@ -161,7 +160,9 @@
static Proto* LoadFunction(LoadState* S, TString* p)
{
- Proto* f=luaF_newproto(S->L);
+ Proto* f;
+ if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
+ f=luaF_newproto(S->L);
setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
f->source=LoadString(S); if (f->source==NULL) f->source=p;
f->linedefined=LoadInt(S);
@@ -175,6 +176,7 @@
LoadDebug(S,f);
IF (!luaG_checkcode(f), "bad code");
S->L->top--;
+ S->L->nCcalls--;
return f;
}
|
|
Deleted |
lua-5.1.tar.gz
^
|
[-]
[+]
|
Deleted |
lua51-rpmlintrc
^
|
@@ -1 +0,0 @@
-addFilter("shlib-policy-name-error")
|
[-]
[+]
|
Added |
macros.lua
^
|
@@ -0,0 +1,10 @@
+# RPM macros for Lua
+
+# The major.minor version of Lua
+%lua_version %(lua -e 'print(_VERSION)' | cut -d ' ' -f 2)
+
+# compiled modules should go here
+%lua_archdir %{_libdir}/lua/%{lua_version}
+
+# pure Lua modules should go here
+%lua_noarchdir %{_datadir}/lua/%{lua_version}
|
[-]
[+]
|
Deleted |
refman-5.0.pdf
^
|
@@ -1,10015 +0,0 @@
-%PDF-1.3
-5 0 obj
-<< /S /GoTo /D (section.1) >>
-endobj
-8 0 obj
-(Introduction)
-endobj
-9 0 obj
-<< /S /GoTo /D (section.2) >>
-endobj
-12 0 obj
-(The Language)
-endobj
-13 0 obj
-<< /S /GoTo /D (subsection.2.1) >>
-endobj
-16 0 obj
-(Lexical Conventions)
-endobj
-17 0 obj
-<< /S /GoTo /D (subsection.2.2) >>
-endobj
-20 0 obj
-(Values and Types)
-endobj
-21 0 obj
-<< /S /GoTo /D (subsubsection.2.2.1) >>
-endobj
-24 0 obj
-(Coercion)
-endobj
-25 0 obj
-<< /S /GoTo /D (subsection.2.3) >>
-endobj
-28 0 obj
-(Variables)
-endobj
-29 0 obj
-<< /S /GoTo /D (subsection.2.4) >>
-endobj
-32 0 obj
-(Statements)
-endobj
-33 0 obj
-<< /S /GoTo /D (subsubsection.2.4.1) >>
-endobj
-36 0 obj
-(Chunks)
-endobj
-37 0 obj
-<< /S /GoTo /D (subsubsection.2.4.2) >>
-endobj
-40 0 obj
-(Blocks)
-endobj
-41 0 obj
-<< /S /GoTo /D (subsubsection.2.4.3) >>
-endobj
-44 0 obj
-(Assignment)
-endobj
-45 0 obj
-<< /S /GoTo /D (subsubsection.2.4.4) >>
-endobj
-48 0 obj
-(Control Structures)
-endobj
-49 0 obj
-<< /S /GoTo /D (subsubsection.2.4.5) >>
-endobj
-52 0 obj
-(For Statement)
-endobj
-53 0 obj
-<< /S /GoTo /D (subsubsection.2.4.6) >>
-endobj
-56 0 obj
-(Function Calls as Statements)
-endobj
-57 0 obj
-<< /S /GoTo /D (subsubsection.2.4.7) >>
-endobj
-60 0 obj
-(Local Declarations)
-endobj
-61 0 obj
-<< /S /GoTo /D (subsection.2.5) >>
-endobj
-64 0 obj
-(Expressions)
-endobj
-65 0 obj
-<< /S /GoTo /D (subsubsection.2.5.1) >>
-endobj
-68 0 obj
-(Arithmetic Operators)
-endobj
-69 0 obj
-<< /S /GoTo /D (subsubsection.2.5.2) >>
-endobj
-72 0 obj
-(Relational Operators)
-endobj
-73 0 obj
-<< /S /GoTo /D (subsubsection.2.5.3) >>
-endobj
-76 0 obj
-(Logical Operators)
-endobj
-77 0 obj
-<< /S /GoTo /D (subsubsection.2.5.4) >>
-endobj
-80 0 obj
-(Concatenation)
-endobj
-81 0 obj
-<< /S /GoTo /D (subsubsection.2.5.5) >>
-endobj
-84 0 obj
-(Precedence)
-endobj
-85 0 obj
-<< /S /GoTo /D (subsubsection.2.5.6) >>
-endobj
-88 0 obj
-(Table Constructors)
-endobj
-89 0 obj
-<< /S /GoTo /D (subsubsection.2.5.7) >>
-endobj
-92 0 obj
-(Function Calls)
-endobj
-93 0 obj
-<< /S /GoTo /D (subsubsection.2.5.8) >>
-endobj
-96 0 obj
-(Function Definitions)
-endobj
-97 0 obj
-<< /S /GoTo /D (subsection.2.6) >>
-endobj
-100 0 obj
-(Visibility Rules)
-endobj
-101 0 obj
-<< /S /GoTo /D (subsection.2.7) >>
-endobj
-104 0 obj
-(Error Handling)
-endobj
-105 0 obj
-<< /S /GoTo /D (subsection.2.8) >>
-endobj
-108 0 obj
-(Metatables)
-endobj
-109 0 obj
-<< /S /GoTo /D (subsection.2.9) >>
-endobj
-112 0 obj
-(Garbage Collection)
-endobj
-113 0 obj
-<< /S /GoTo /D (subsubsection.2.9.1) >>
-endobj
-116 0 obj
-(Garbage-Collection Metamethods)
-endobj
-117 0 obj
-<< /S /GoTo /D (subsubsection.2.9.2) >>
-endobj
-120 0 obj
-(Weak Tables)
-endobj
-121 0 obj
-<< /S /GoTo /D (subsection.2.10) >>
-endobj
-124 0 obj
-(Coroutines)
-endobj
-125 0 obj
-<< /S /GoTo /D (section.3) >>
-endobj
-128 0 obj
-(The Application Program Interface)
-endobj
-129 0 obj
-<< /S /GoTo /D (subsection.3.1) >>
-endobj
-132 0 obj
-(States)
-endobj
-133 0 obj
-<< /S /GoTo /D (subsection.3.2) >>
-endobj
-136 0 obj
-(The Stack and Indices)
-endobj
|