Skip to content

Commit

Permalink
Patched 5.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomg committed Aug 10, 2024
2 parents 5fb1c6e + 7d87cf2 commit 495c6df
Show file tree
Hide file tree
Showing 37 changed files with 431 additions and 306 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ TO_MAN= lua.1 luac.1

# Lua version and release.
V= 5.4
R= $V.6
R= $V.7

# Targets start here.
all: $(PLAT)
Expand Down
Binary file added doc/OSIApproved_100X125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions doc/contents.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<BODY>

<H1>
<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
<A HREF="https://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
Lua 5.4 Reference Manual
</H1>

<P>
The reference manual is the official definition of the Lua language.
<BR>
For a complete introduction to Lua programming, see the book
<A HREF="http://www.lua.org/pil/">Programming in Lua</A>.
<A HREF="https://www.lua.org/pil/">Programming in Lua</A>.

<DIV CLASS="menubar">
<A HREF="manual.html">start</A>
Expand All @@ -27,14 +27,14 @@ <H1>
&middot;
<A HREF="#index">index</A>
&middot;
<A HREF="http://www.lua.org/manual/">other versions</A>
<A HREF="https://www.lua.org/manual/">other versions</A>
</DIV>

<P>
<SMALL>
Copyright &copy; 2020&ndash;2023 Lua.org, PUC-Rio.
Copyright &copy; 2020&ndash;2024 Lua.org, PUC-Rio.
Freely available under the terms of the
<A HREF="http://www.lua.org/license.html">Lua license</A>.
<A HREF="https://www.lua.org/license.html">Lua license</A>.
</SMALL>

<H2><A NAME="contents">Contents</A></H2>
Expand Down Expand Up @@ -668,10 +668,10 @@ <H3><A NAME="constants">constants</A></H3>

<P CLASS="footer">
Last update:
Sat Apr 1 17:57:05 UTC 2023
Thu May 9 14:47:09 UTC 2024
</P>
<!--
Last change: revised for Lua 5.4.5
Last change: revised for Lua 5.4.7
-->

</BODY>
Expand Down
6 changes: 3 additions & 3 deletions doc/lua.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" $Id: lua.man,v 1.14 2022/09/23 09:06:36 lhf Exp $
.TH LUA 1 "$Date: 2022/09/23 09:06:36 $"
.\" $Id: lua.man,v 1.14 2024/05/08 18:48:27 lhf Exp $
.TH LUA 1 "$Date: 2024/05/08 18:48:27 $"
.SH NAME
lua \- Lua interpreter
.SH SYNOPSIS
Expand Down Expand Up @@ -123,7 +123,7 @@ and the version-neutral variants are ignored.
Code to be executed before command line options and scripts.
.TP
.B LUA_PATH, LUA_PATH_5_4
Initial value of package.cpath,
Initial value of package.path,
the path used by require to search for Lua loaders.
.TP
.B LUA_CPATH, LUA_CPATH_5_4
Expand Down
1 change: 1 addition & 0 deletions doc/lua.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ table.book td.cover {

table.book img {
border: solid #000080 1px ;
border-radius: 2px ;
}

table.book span {
Expand Down
50 changes: 32 additions & 18 deletions doc/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<BODY>

<H1>
<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
<A HREF="https://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
Lua 5.4 Reference Manual
</H1>

Expand All @@ -19,17 +19,17 @@ <H1>

<P>
<SMALL>
Copyright &copy; 2020&ndash;2023 Lua.org, PUC-Rio.
Copyright &copy; 2020&ndash;2024 Lua.org, PUC-Rio.
Freely available under the terms of the
<a href="http://www.lua.org/license.html">Lua license</a>.
<a href="https://www.lua.org/license.html">Lua license</a>.
</SMALL>

<DIV CLASS="menubar">
<A HREF="contents.html#contents">contents</A>
&middot;
<A HREF="contents.html#index">index</A>
&middot;
<A HREF="http://www.lua.org/manual/">other versions</A>
<A HREF="https://www.lua.org/manual/">other versions</A>
</DIV>

<!-- ====================================================================== -->
Expand Down Expand Up @@ -391,7 +391,7 @@ <h2>2.3 &ndash; <a name="2.3">Error Handling</a></h2>
an <em>error object</em>
is propagated with information about the error.
Lua itself only generates errors whose error object is a string,
but programs may generate errors with
but programs can generate errors with
any value as the error object.
It is up to the Lua program or its host to handle such error objects.
For historical reasons,
Expand All @@ -401,7 +401,7 @@ <h2>2.3 &ndash; <a name="2.3">Error Handling</a></h2>

<p>
When you use <a href="#pdf-xpcall"><code>xpcall</code></a> (or <a href="#lua_pcall"><code>lua_pcall</code></a>, in C)
you may give a <em>message handler</em>
you can give a <em>message handler</em>
to be called in case of errors.
This function is called with the original error object
and returns a new error object.
Expand Down Expand Up @@ -453,7 +453,7 @@ <h2>2.4 &ndash; <a name="2.4">Metatables and Metamethods</a></h2>
In the previous example, the key is the string "<code>__add</code>"
and the metamethod is the function that performs the addition.
Unless stated otherwise,
a metamethod may in fact be any callable value,
a metamethod can in fact be any callable value,
which is either a function or a value with a <code>__call</code> metamethod.


Expand Down Expand Up @@ -1725,7 +1725,7 @@ <h3>3.3.4 &ndash; <a name="3.3.4">Control Structures</a></h3><p>
<p>
A label is visible in the entire block where it is defined,
except inside nested functions.
A goto may jump to any visible label as long as it does not
A goto can jump to any visible label as long as it does not
enter into the scope of a local variable.
A label should not be declared
where a label with the same name is visible,
Expand Down Expand Up @@ -5571,7 +5571,7 @@ <h2>4.6 &ndash; <a name="4.6">Functions and Types</a></h2>


<hr><h3><a name="lua_toclose"><code>lua_toclose</code></a></h3><p>
<span class="apii">[-0, +0, <em>m</em>]</span>
<span class="apii">[-0, +0, <em>v</em>]</span>
<pre>void lua_toclose (lua_State *L, int index);</pre>

<p>
Expand All @@ -5591,6 +5591,11 @@ <h2>4.6 &ndash; <a name="4.6">Functions and Types</a></h2>
unless previously deactivated by <a href="#lua_closeslot"><code>lua_closeslot</code></a>.


<p>
This function raises an error if the value at the given slot
neither has a <code>__close</code> metamethod nor is a false value.


<p>
This function should not be called for an index
that is equal to or below an active to-be-closed slot.
Expand Down Expand Up @@ -5664,6 +5669,12 @@ <h2>4.6 &ndash; <a name="4.6">Functions and Types</a></h2>
but can contain other zeros in its body.


<p>
This function can raise memory errors only
when converting a number to a string
(as then it may create a new string).





Expand Down Expand Up @@ -11276,13 +11287,13 @@ <h2>6.10 &ndash; <a name="6.10">The Debug Library</a></h2>
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.
If present,
the option '<code>f</code>'
The option '<code>f</code>'
adds a field named <code>func</code> with the function itself.
If present,
the option '<code>L</code>'
adds a field named <code>activelines</code> with the table of
valid lines.
The option '<code>L</code>' adds a field named <code>activelines</code>
with the table of valid lines,
provided the function is a Lua function.
If the function has no debug information,
the table is empty.


<p>
Expand Down Expand Up @@ -11619,6 +11630,10 @@ <h1>7 &ndash; <a name="7">Lua Standalone</a></h1>
In particular,
the values of <a href="#pdf-package.path"><code>package.path</code></a> and <a href="#pdf-package.cpath"><code>package.cpath</code></a>
are set with the default paths defined in <code>luaconf.h</code>.
To signal to the libraries that this option is on,
the stand-alone interpreter sets the field
<code>"LUA_NOENV"</code> in the registry to a true value.
Other libraries may consult this field for the same purpose.


<p>
Expand Down Expand Up @@ -12033,13 +12048,12 @@ <h1>9 &ndash; <a name="9">The Complete Syntax of Lua</a></h1>




<P CLASS="footer">
Last update:
Tue May 2 20:09:38 UTC 2023
Thu Jun 13 22:15:52 UTC 2024
</P>
<!--
Last change: revised for Lua 5.4.6
Last change: revised for Lua 5.4.7
-->

</body></html>
Expand Down
Binary file removed doc/osi-certified-72x60.png
Binary file not shown.
48 changes: 25 additions & 23 deletions doc/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<BODY>

<H1>
<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
<A HREF="https://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
Welcome to Lua 5.4
</H1>

Expand All @@ -49,37 +49,39 @@ <H2><A NAME="about">About Lua</A></H2>
<P>
Lua is a powerful, efficient, lightweight, embeddable scripting language
developed by a
<A HREF="http://www.lua.org/authors.html">team</A>
<A HREF="https://www.lua.org/authors.html">team</A>
at
<A HREF="http://www.puc-rio.br/">PUC-Rio</A>,
<A HREF="https://www.puc-rio.br/">PUC-Rio</A>,
the Pontifical Catholic University of Rio de Janeiro in Brazil.
Lua is
<A HREF="#license">free software</A>
used in
<A HREF="http://www.lua.org/uses.html">many products and projects</A>
<A HREF="https://www.lua.org/uses.html">many products and projects</A>
around the world.

<P>
Lua's
<A HREF="http://www.lua.org/">official web site</A>
<A HREF="https://www.lua.org/">official website</A>
provides complete information
about Lua,
including
an
<A HREF="http://www.lua.org/about.html">executive summary</A>
<A HREF="https://www.lua.org/about.html">executive summary</A>,
tips on
<A HREF="https://www.lua.org/start.html">getting started</A>,
and
updated
<A HREF="http://www.lua.org/docs.html">documentation</A>,
<A HREF="https://www.lua.org/docs.html">documentation</A>,
especially the
<A HREF="http://www.lua.org/manual/5.4/">reference manual</A>,
<A HREF="https://www.lua.org/manual/5.4/">reference manual</A>,
which may differ slightly from the
<A HREF="contents.html">local copy</A>
distributed in this package.

<H2><A NAME="install">Installing Lua</A></H2>
<P>
Lua is distributed in
<A HREF="http://www.lua.org/ftp/">source</A>
<A HREF="https://www.lua.org/ftp/">source</A>
form.
You need to build it before using it.
Building Lua should be straightforward
Expand All @@ -88,7 +90,7 @@ <H2><A NAME="install">Installing Lua</A></H2>
platforms that have an ANSI C compiler.
Lua also compiles unmodified as C++.
The instructions given below for building Lua are for Unix-like platforms,
such as Linux and Mac OS X.
such as Linux and macOS.
See also
<A HREF="#other">instructions for other systems</A>
and
Expand All @@ -97,7 +99,7 @@ <H2><A NAME="install">Installing Lua</A></H2>
<P>
If you don't have the time or the inclination to compile Lua yourself,
get a binary from
<A HREF="http://lua-users.org/wiki/LuaBinaries">LuaBinaries</A>.
<A HREF="https://luabinaries.sourceforge.net">LuaBinaries</A>.

<H3>Building Lua</H3>
<P>
Expand All @@ -107,7 +109,7 @@ <H3>Building Lua</H3>
<OL>
<LI>
Open a terminal window and move to
the top-level directory, which is named <TT>lua-5.4.6</TT>.
the top-level directory, which is named <TT>lua-5.4.7</TT>.
The <TT>Makefile</TT> there controls both the build process and the installation process.
<P>
<LI>
Expand Down Expand Up @@ -211,8 +213,8 @@ <H3><A NAME="customization">Customization</A></H3>
record the changes you've made.

<P>
On the other hand, if you need to customize some Lua features, you'll need
to edit <TT>src/luaconf.h</TT> before building and installing Lua.
On the other hand, if you need to customize some Lua features,
edit <TT>src/luaconf.h</TT> before building and installing Lua.
The edited file will be the one installed, and
it will be used by any Lua clients that you build, to ensure consistency.
Further customization is available to experts by editing the Lua sources.
Expand Down Expand Up @@ -241,7 +243,7 @@ <H3><A NAME="other">Building Lua on other systems</A></H3>
</DL>

<P>
To use Lua as a library in your own programs, you'll need to know how to
To use Lua as a library in your own programs, you need to know how to
create and use libraries with your compiler. Moreover, to dynamically load
C libraries for Lua, you'll need to know how to create dynamic libraries
and you'll need to make sure that the Lua API functions are accessible to
Expand Down Expand Up @@ -284,23 +286,23 @@ <H3>Main changes</H3>

<H2><A NAME="license">License</A></H2>
<P>
<A HREF="http://www.opensource.org/docs/definition.php">
<IMG SRC="osi-certified-72x60.png" ALIGN="right" ALT="[osi certified]" STYLE="padding-left: 30px ;">
<A HREF="https://opensource.org/osd">
<IMG SRC="OSIApproved_100X125.png" ALIGN="right" ALT="[Open Source Initiative Approved License]" STYLE="padding-left: 1em" WIDTH=50>
</A>
Lua is free software distributed under the terms of the
<A HREF="http://www.opensource.org/licenses/mit-license.html">MIT license</A>
<A HREF="https://opensource.org/license/mit">MIT license</A>
reproduced below;
it may be used for any purpose, including commercial purposes,
at absolutely no cost without having to ask us.

The only requirement is that if you do use Lua,
then you should give us credit by including the appropriate copyright notice somewhere in your product or its documentation.

For details, see
<A HREF="http://www.lua.org/license.html">this</A>.
For details, see the
<A HREF="https://www.lua.org/license.html">license page</A>.

<BLOCKQUOTE STYLE="padding-bottom: 0em">
Copyright &copy; 1994&ndash;2023 Lua.org, PUC-Rio.
Copyright &copy; 1994&ndash;2024 Lua.org, PUC-Rio.

<P>
Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -327,10 +329,10 @@ <H2><A NAME="license">License</A></H2>

<P CLASS="footer">
Last update:
Tue May 2 20:08:55 UTC 2023
Wed May 8 21:56:16 UTC 2024
</P>
<!--
Last change: revised for Lua 5.4.6
Last change: revised for Lua 5.4.7
-->

</BODY>
Expand Down
4 changes: 2 additions & 2 deletions src/lapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
o = index2value(L, idx); /* previous call may reallocate the stack */
}
if (len != NULL)
*len = vslen(o);
*len = tsslen(tsvalue(o));
lua_unlock(L);
return svalue(o);
return getstr(tsvalue(o));
}


Expand Down
Loading

0 comments on commit 495c6df

Please sign in to comment.