#define CVT_BUF_SIZE 64
#define LUA_VER_BUFSIZ 20
+#define LUA_COPYRIGHT_BUFSIZ 120
struct instance_globals {
/* new stuff */
char lua_ver[LUA_VER_BUFSIZ];
+ char lua_copyright[LUA_COPYRIGHT_BUFSIZ];
unsigned long magic; /* validate that structure layout is preserved */
};
/* new */
DUMMY, /* lua_ver[LUA_VER_BUFSIZ] */
+ DUMMY, /* lua_copyright[LUA_COPYRIGHT_BUFSIZ] */
IVMAGIC /* used to validate that structure layout has been preserved */
};
{
static const char *lua_info[] = {
"", "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
1234567890123456789012345678901234567890123456789012345678901234567890123456
*/
Strcpy(g.lua_ver, vs);
}
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;
}
} rt_opts[] = {
{ ":PATMATCH:", regex_id },
{ ":LUAVERSION:", (const char *) g.lua_ver + 3 }, /* +3 skip past "Lua" */
+#ifdef LUA_COPYRIGHT
+ { ":LUACOPYRIGHT:", (const char *) g.lua_copyright },
+#endif
};
/*
if (!g.lua_ver[0])
get_lua_version();
-
+
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);
+ }
/* we don't break out of the loop after a match; there might be
other matches on the same line */
}