Skip to content

Commit 441cd7b

Browse files
committed
lua-5.4.7 2024-06-13
1 parent e28137e commit 441cd7b

38 files changed

+432
-307
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ TO_MAN= lua.1 luac.1
4646

4747
# Lua version and release.
4848
V= 5.4
49-
R= $V.6
49+
R= $V.7
5050

5151
# Targets start here.
5252
all: $(PLAT)

README

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
This is Lua 5.4.6, released on 02 May 2023.
2+
This is Lua 5.4.7, released on 13 Jun 2024.
33

44
For installation instructions, license details, and
55
further information about Lua, see doc/readme.html.

doc/OSIApproved_100X125.png

11.8 KB
Loading

doc/contents.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
<BODY>
1111

1212
<H1>
13-
<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
13+
<A HREF="https://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
1414
Lua 5.4 Reference Manual
1515
</H1>
1616

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

2323
<DIV CLASS="menubar">
2424
<A HREF="manual.html">start</A>
@@ -27,14 +27,14 @@ <H1>
2727
&middot;
2828
<A HREF="#index">index</A>
2929
&middot;
30-
<A HREF="http://www.lua.org/manual/">other versions</A>
30+
<A HREF="https://www.lua.org/manual/">other versions</A>
3131
</DIV>
3232

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

4040
<H2><A NAME="contents">Contents</A></H2>
@@ -668,10 +668,10 @@ <H3><A NAME="constants">constants</A></H3>
668668

669669
<P CLASS="footer">
670670
Last update:
671-
Sat Apr 1 17:57:05 UTC 2023
671+
Thu May 9 14:47:09 UTC 2024
672672
</P>
673673
<!--
674-
Last change: revised for Lua 5.4.5
674+
Last change: revised for Lua 5.4.7
675675
-->
676676

677677
</BODY>

doc/lua.1

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.\" $Id: lua.man,v 1.14 2022/09/23 09:06:36 lhf Exp $
2-
.TH LUA 1 "$Date: 2022/09/23 09:06:36 $"
1+
.\" $Id: lua.man,v 1.14 2024/05/08 18:48:27 lhf Exp $
2+
.TH LUA 1 "$Date: 2024/05/08 18:48:27 $"
33
.SH NAME
44
lua \- Lua interpreter
55
.SH SYNOPSIS
@@ -123,7 +123,7 @@ and the version-neutral variants are ignored.
123123
Code to be executed before command line options and scripts.
124124
.TP
125125
.B LUA_PATH, LUA_PATH_5_4
126-
Initial value of package.cpath,
126+
Initial value of package.path,
127127
the path used by require to search for Lua loaders.
128128
.TP
129129
.B LUA_CPATH, LUA_CPATH_5_4

doc/lua.css

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ table.book td.cover {
143143

144144
table.book img {
145145
border: solid #000080 1px ;
146+
border-radius: 2px ;
146147
}
147148

148149
table.book span {

doc/manual.html

+32-18
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<BODY>
1111

1212
<H1>
13-
<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
13+
<A HREF="https://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
1414
Lua 5.4 Reference Manual
1515
</H1>
1616

@@ -19,17 +19,17 @@ <H1>
1919

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

2727
<DIV CLASS="menubar">
2828
<A HREF="contents.html#contents">contents</A>
2929
&middot;
3030
<A HREF="contents.html#index">index</A>
3131
&middot;
32-
<A HREF="http://www.lua.org/manual/">other versions</A>
32+
<A HREF="https://www.lua.org/manual/">other versions</A>
3333
</DIV>
3434

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

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

459459

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

55725572

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

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

55935593

5594+
<p>
5595+
This function raises an error if the value at the given slot
5596+
neither has a <code>__close</code> metamethod nor is a false value.
5597+
5598+
55945599
<p>
55955600
This function should not be called for an index
55965601
that is equal to or below an active to-be-closed slot.
@@ -5664,6 +5669,12 @@ <h2>4.6 &ndash; <a name="4.6">Functions and Types</a></h2>
56645669
but can contain other zeros in its body.
56655670

56665671

5672+
<p>
5673+
This function can raise memory errors only
5674+
when converting a number to a string
5675+
(as then it may create a new string).
5676+
5677+
56675678

56685679

56695680

@@ -11276,13 +11287,13 @@ <h2>6.10 &ndash; <a name="6.10">The Debug Library</a></h2>
1127611287
with the string <code>what</code> describing which fields to fill in.
1127711288
The default for <code>what</code> is to get all information available,
1127811289
except the table of valid lines.
11279-
If present,
11280-
the option '<code>f</code>'
11290+
The option '<code>f</code>'
1128111291
adds a field named <code>func</code> with the function itself.
11282-
If present,
11283-
the option '<code>L</code>'
11284-
adds a field named <code>activelines</code> with the table of
11285-
valid lines.
11292+
The option '<code>L</code>' adds a field named <code>activelines</code>
11293+
with the table of valid lines,
11294+
provided the function is a Lua function.
11295+
If the function has no debug information,
11296+
the table is empty.
1128611297

1128711298

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

1162311638

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

1203412049

1203512050

12036-
1203712051
<P CLASS="footer">
1203812052
Last update:
12039-
Tue May 2 20:09:38 UTC 2023
12053+
Thu Jun 13 22:15:52 UTC 2024
1204012054
</P>
1204112055
<!--
12042-
Last change: revised for Lua 5.4.6
12056+
Last change: revised for Lua 5.4.7
1204312057
-->
1204412058

1204512059
</body></html>

doc/osi-certified-72x60.png

-3.69 KB
Binary file not shown.

doc/readme.html

+25-23
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<BODY>
3030

3131
<H1>
32-
<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
32+
<A HREF="https://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
3333
Welcome to Lua 5.4
3434
</H1>
3535

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

6262
<P>
6363
Lua's
64-
<A HREF="http://www.lua.org/">official web site</A>
64+
<A HREF="https://www.lua.org/">official website</A>
6565
provides complete information
6666
about Lua,
6767
including
6868
an
69-
<A HREF="http://www.lua.org/about.html">executive summary</A>
69+
<A HREF="https://www.lua.org/about.html">executive summary</A>,
70+
tips on
71+
<A HREF="https://www.lua.org/start.html">getting started</A>,
7072
and
7173
updated
72-
<A HREF="http://www.lua.org/docs.html">documentation</A>,
74+
<A HREF="https://www.lua.org/docs.html">documentation</A>,
7375
especially the
74-
<A HREF="http://www.lua.org/manual/5.4/">reference manual</A>,
76+
<A HREF="https://www.lua.org/manual/5.4/">reference manual</A>,
7577
which may differ slightly from the
7678
<A HREF="contents.html">local copy</A>
7779
distributed in this package.
7880

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

102104
<H3>Building Lua</H3>
103105
<P>
@@ -107,7 +109,7 @@ <H3>Building Lua</H3>
107109
<OL>
108110
<LI>
109111
Open a terminal window and move to
110-
the top-level directory, which is named <TT>lua-5.4.6</TT>.
112+
the top-level directory, which is named <TT>lua-5.4.7</TT>.
111113
The <TT>Makefile</TT> there controls both the build process and the installation process.
112114
<P>
113115
<LI>
@@ -211,8 +213,8 @@ <H3><A NAME="customization">Customization</A></H3>
211213
record the changes you've made.
212214

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

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

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

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

299-
For details, see
300-
<A HREF="http://www.lua.org/license.html">this</A>.
301+
For details, see the
302+
<A HREF="https://www.lua.org/license.html">license page</A>.
301303

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

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

328330
<P CLASS="footer">
329331
Last update:
330-
Tue May 2 20:08:55 UTC 2023
332+
Wed May 8 21:56:16 UTC 2024
331333
</P>
332334
<!--
333-
Last change: revised for Lua 5.4.6
335+
Last change: revised for Lua 5.4.7
334336
-->
335337

336338
</BODY>

src/lapi.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,9 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
417417
o = index2value(L, idx); /* previous call may reallocate the stack */
418418
}
419419
if (len != NULL)
420-
*len = vslen(o);
420+
*len = tsslen(tsvalue(o));
421421
lua_unlock(L);
422-
return svalue(o);
422+
return getstr(tsvalue(o));
423423
}
424424

425425

0 commit comments

Comments
 (0)