use the copyright statement provided by the Lua distribution in lua.h
This commit is contained in:
@@ -701,6 +701,7 @@ struct role_filter {
|
|||||||
#define CVT_BUF_SIZE 64
|
#define CVT_BUF_SIZE 64
|
||||||
|
|
||||||
#define LUA_VER_BUFSIZ 20
|
#define LUA_VER_BUFSIZ 20
|
||||||
|
#define LUA_COPYRIGHT_BUFSIZ 120
|
||||||
|
|
||||||
struct instance_globals {
|
struct instance_globals {
|
||||||
|
|
||||||
@@ -1257,6 +1258,7 @@ struct instance_globals {
|
|||||||
|
|
||||||
/* new stuff */
|
/* new stuff */
|
||||||
char lua_ver[LUA_VER_BUFSIZ];
|
char lua_ver[LUA_VER_BUFSIZ];
|
||||||
|
char lua_copyright[LUA_COPYRIGHT_BUFSIZ];
|
||||||
|
|
||||||
unsigned long magic; /* validate that structure layout is preserved */
|
unsigned long magic; /* validate that structure layout is preserved */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -693,6 +693,7 @@ const struct instance_globals g_init = {
|
|||||||
|
|
||||||
/* new */
|
/* new */
|
||||||
DUMMY, /* lua_ver[LUA_VER_BUFSIZ] */
|
DUMMY, /* lua_ver[LUA_VER_BUFSIZ] */
|
||||||
|
DUMMY, /* lua_copyright[LUA_COPYRIGHT_BUFSIZ] */
|
||||||
|
|
||||||
IVMAGIC /* used to validate that structure layout has been preserved */
|
IVMAGIC /* used to validate that structure layout has been preserved */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -637,7 +637,7 @@ build_options()
|
|||||||
{
|
{
|
||||||
static const char *lua_info[] = {
|
static const char *lua_info[] = {
|
||||||
"", "NetHack 3.7.* uses the 'Lua' interpreter to process some data:", "",
|
"", "NetHack 3.7.* uses the 'Lua' interpreter to process some data:", "",
|
||||||
" About Lua:LUAVERSION:: Copyright (c) 1994-2017 Lua.org, PUC-Rio.", "",
|
" :LUACOPYRIGHT:", "",
|
||||||
/* 1 2 3 4 5 6 7
|
/* 1 2 3 4 5 6 7
|
||||||
1234567890123456789012345678901234567890123456789012345678901234567890123456
|
1234567890123456789012345678901234567890123456789012345678901234567890123456
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -923,6 +923,10 @@ get_lua_version()
|
|||||||
Strcpy(g.lua_ver, vs);
|
Strcpy(g.lua_ver, vs);
|
||||||
}
|
}
|
||||||
lua_close(L);
|
lua_close(L);
|
||||||
|
#ifdef LUA_COPYRIGHT
|
||||||
|
if (sizeof LUA_COPYRIGHT < sizeof g.lua_copyright - 1)
|
||||||
|
Strcpy(g.lua_copyright, LUA_COPYRIGHT);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return (const char *) g.lua_ver;
|
return (const char *) g.lua_ver;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -304,6 +304,9 @@ static struct rt_opt {
|
|||||||
} rt_opts[] = {
|
} rt_opts[] = {
|
||||||
{ ":PATMATCH:", regex_id },
|
{ ":PATMATCH:", regex_id },
|
||||||
{ ":LUAVERSION:", (const char *) g.lua_ver + 3 }, /* +3 skip past "Lua" */
|
{ ":LUAVERSION:", (const char *) g.lua_ver + 3 }, /* +3 skip past "Lua" */
|
||||||
|
#ifdef LUA_COPYRIGHT
|
||||||
|
{ ":LUACOPYRIGHT:", (const char *) g.lua_copyright },
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -320,10 +323,11 @@ char *buf;
|
|||||||
|
|
||||||
if (!g.lua_ver[0])
|
if (!g.lua_ver[0])
|
||||||
get_lua_version();
|
get_lua_version();
|
||||||
|
|
||||||
for (i = 0; i < SIZE(rt_opts); ++i) {
|
for (i = 0; i < SIZE(rt_opts); ++i) {
|
||||||
if (strstri(buf, rt_opts[i].token) && *rt_opts[i].value)
|
if (strstri(buf, rt_opts[i].token) && *rt_opts[i].value) {
|
||||||
(void) strsubst(buf, rt_opts[i].token, rt_opts[i].value);
|
(void) strsubst(buf, rt_opts[i].token, rt_opts[i].value);
|
||||||
|
}
|
||||||
/* we don't break out of the loop after a match; there might be
|
/* we don't break out of the loop after a match; there might be
|
||||||
other matches on the same line */
|
other matches on the same line */
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user