mirror of
https://github.com/lua/lua.git
synced 2026-07-27 08:29:08 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfce6f4b20 | ||
|
|
1da89da62f | ||
|
|
f6c627af20 |
5
loslib.c
5
loslib.c
@@ -273,7 +273,7 @@ static int getfield (lua_State *L, const char *key, int d, int delta) {
|
||||
|
||||
|
||||
static const char *checkoption (lua_State *L, const char *conv,
|
||||
ptrdiff_t convlen, char *buff) {
|
||||
size_t convlen, char *buff) {
|
||||
const char *option = LUA_STRFTIMEOPTIONS;
|
||||
unsigned oplen = 1; /* length of options being checked */
|
||||
for (; *option != '\0' && oplen <= convlen; option += oplen) {
|
||||
@@ -333,7 +333,8 @@ static int os_date (lua_State *L) {
|
||||
size_t reslen;
|
||||
char *buff = luaL_prepbuffsize(&b, SIZETIMEFMT);
|
||||
s++; /* skip '%' */
|
||||
s = checkoption(L, s, se - s, cc + 1); /* copy specifier to 'cc' */
|
||||
/* copy specifier to 'cc' */
|
||||
s = checkoption(L, s, ct_diff2sz(se - s), cc + 1);
|
||||
reslen = strftime(buff, SIZETIMEFMT, cc, stm);
|
||||
luaL_addsize(&b, reslen);
|
||||
}
|
||||
|
||||
4
lua.c
4
lua.c
@@ -488,8 +488,8 @@ static void lua_freeline (char *line) {
|
||||
static void lua_initreadline(lua_State *L) {
|
||||
UNUSED(L);
|
||||
rl_readline_name = "lua";
|
||||
l_readline = readline;
|
||||
l_addhist = add_history;
|
||||
l_readline = cast(l_readlineT, readline);
|
||||
l_addhist = cast(l_addhistT, add_history);
|
||||
}
|
||||
|
||||
#elif defined(LUA_USE_DLOPEN) && defined(LUA_READLINELIB) /* }{ */
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
---------------------------------------------------------------
|
||||
header = [[
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Lua 5.4 Reference Manual</title>
|
||||
<title>Lua 5.5 Reference Manual</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
<link rel="stylesheet" href="lua.css">
|
||||
<link rel="stylesheet" href="manual.css">
|
||||
@@ -23,7 +23,7 @@ header = [[
|
||||
<hr>
|
||||
<h1>
|
||||
<a href="http://www.lua.org/home.html"><img src="logo.gif" alt="[Lua logo]" border="0"></a>
|
||||
Lua 5.4 Reference Manual
|
||||
Lua 5.5 Reference Manual
|
||||
</h1>
|
||||
|
||||
by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes
|
||||
|
||||
@@ -6908,7 +6908,7 @@ and @St{userdata}.
|
||||
|
||||
A global variable (not a function) that
|
||||
holds a string containing the running Lua version.
|
||||
The current value of this variable is @St{Lua 5.4}.
|
||||
The current value of this variable is @St{Lua 5.5}.
|
||||
|
||||
}
|
||||
|
||||
@@ -7154,7 +7154,7 @@ to search for a @N{C loader}.
|
||||
|
||||
Lua initializes the @N{C path} @Lid{package.cpath} in the same way
|
||||
it initializes the Lua path @Lid{package.path},
|
||||
using the environment variable @defid{LUA_CPATH_5_4},
|
||||
using the environment variable @defid{LUA_CPATH_5_5},
|
||||
or the environment variable @defid{LUA_CPATH},
|
||||
or a default path defined in @id{luaconf.h}.
|
||||
|
||||
@@ -7223,7 +7223,7 @@ A string with the path used by @Lid{require}
|
||||
to search for a Lua loader.
|
||||
|
||||
At start-up, Lua initializes this variable with
|
||||
the value of the environment variable @defid{LUA_PATH_5_4} or
|
||||
the value of the environment variable @defid{LUA_PATH_5_5} or
|
||||
the environment variable @defid{LUA_PATH} or
|
||||
with a default path defined in @id{luaconf.h},
|
||||
if those environment variables are not defined.
|
||||
@@ -7594,9 +7594,9 @@ x = string.gsub("4+5 = $return 4+5$", "%$(.-)%$", function (s)
|
||||
end)
|
||||
-- x="4+5 = 9"
|
||||
|
||||
local t = {name="lua", version="5.4"}
|
||||
local t = {name="lua", version="5.5"}
|
||||
x = string.gsub("$name-$version.tar.gz", "%$(%w+)", t)
|
||||
-- x="lua-5.4.tar.gz"
|
||||
-- x="lua-5.5.tar.gz"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9332,7 +9332,7 @@ when the standard input (@id{stdin}) is a terminal,
|
||||
and as @T{lua -} otherwise.
|
||||
|
||||
When called without the option @T{-E},
|
||||
the interpreter checks for an environment variable @defid{LUA_INIT_5_4}
|
||||
the interpreter checks for an environment variable @defid{LUA_INIT_5_5}
|
||||
(or @defid{LUA_INIT} if the versioned name is not defined)
|
||||
before running any argument.
|
||||
If the variable content has the format @T{@At@rep{filename}},
|
||||
|
||||
Reference in New Issue
Block a user