move lua notice to makedefs.c and dat/options
Prefix the lua notice with a one-line explanation. One minor change: the copyright date didn't match the one from the actual lua notice.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 version.c $NHDT-Date: 1552353060 2019/03/12 01:11:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.52 $ */
|
||||
/* NetHack 3.6 version.c $NHDT-Date: 1575072301 2019/11/30 00:05:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.62 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2018. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -141,12 +141,12 @@ doextversion()
|
||||
char buf[BUFSZ], *p = 0;
|
||||
winid win = create_nhwindow(NHW_TEXT);
|
||||
boolean use_dlb = TRUE,
|
||||
keepgoing = TRUE,
|
||||
done_rt = FALSE,
|
||||
done_dlb = FALSE,
|
||||
prolog;
|
||||
#if 0 /* moved to util/makedefs.c and rendered via dat/options */
|
||||
const char *lua_info[] = {
|
||||
"About Lua: Copyright (c) 1994-2019 Lua.org, PUC-Rio.",
|
||||
"About Lua: Copyright (c) 1994-2017 Lua.org, PUC-Rio.",
|
||||
/* 1 2 3 4 5 6 7
|
||||
1234567890123456789012345678901234567890123456789012345678901234567890123456789
|
||||
*/
|
||||
@@ -161,7 +161,7 @@ doextversion()
|
||||
" included in all copies or substantial portions of the Software.\"",
|
||||
(const char *) 0
|
||||
};
|
||||
|
||||
#endif /*0*/
|
||||
#if defined(OPTIONS_AT_RUNTIME) || defined(CROSSCOMPILE_TARGET)
|
||||
use_dlb = FALSE;
|
||||
#else
|
||||
@@ -215,7 +215,7 @@ doextversion()
|
||||
*/
|
||||
|
||||
prolog = TRUE; /* to skip indented program name */
|
||||
while (keepgoing) {
|
||||
for (;;) {
|
||||
if (use_dlb && !done_dlb) {
|
||||
if (!dlb_fgets(buf, BUFSZ, f)) {
|
||||
done_dlb = TRUE;
|
||||
@@ -225,18 +225,15 @@ doextversion()
|
||||
if (!(rtbuf = do_runtime_info(&rtcontext))) {
|
||||
done_rt = TRUE;
|
||||
continue;
|
||||
} else {
|
||||
if ((int) strlen(rtbuf) >= (BUFSZ - 1))
|
||||
continue;
|
||||
Strcpy(buf, rtbuf);
|
||||
}
|
||||
(void) strncpy(buf, rtbuf, BUFSZ - 1);
|
||||
buf[BUFSZ - 1] = '\0';
|
||||
#if 0 /* handled via dat/options */
|
||||
} else if ((rtbuf = lua_info[rtcontext++]) != 0) {
|
||||
Strcpy(buf, rtbuf);
|
||||
#endif /*0*/
|
||||
} else {
|
||||
if (!(rtbuf = lua_info[rtcontext++])) {
|
||||
keepgoing = FALSE;
|
||||
break;
|
||||
} else {
|
||||
Strcpy(buf, rtbuf);
|
||||
}
|
||||
break;
|
||||
}
|
||||
(void) strip_newline(buf);
|
||||
if (index(buf, '\t') != 0)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 makedefs.c $NHDT-Date: 1574705221 2019/11/25 18:07:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.165 $ */
|
||||
/* NetHack 3.6 makedefs.c $NHDT-Date: 1575072306 2019/11/30 00:05:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.166 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
|
||||
/* Copyright (c) M. Stephenson, 1990, 1991. */
|
||||
@@ -1186,7 +1186,8 @@ do_date()
|
||||
#endif
|
||||
|
||||
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_HOST)
|
||||
Fprintf(ofp, "\n#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_HOST)\n");
|
||||
Fprintf(ofp,
|
||||
"\n#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_HOST)\n");
|
||||
#endif /* CROSSCOMPILE || CROSSCOMPILE_HOST */
|
||||
if (date_via_env)
|
||||
Fprintf(ofp, "#define SOURCE_DATE_EPOCH (%lu%s) /* via getenv() */\n",
|
||||
@@ -1287,11 +1288,13 @@ char *githash, *gitbranch;
|
||||
*end = '\0';
|
||||
|
||||
len = strlen(opt);
|
||||
if ((len >= strlen("gitbranch")) && !case_insensitive_comp(opt, "gitbranch")) {
|
||||
if ((len >= strlen("gitbranch"))
|
||||
&& !case_insensitive_comp(opt, "gitbranch")) {
|
||||
Strcpy(gitbranch, strval);
|
||||
havebranch = TRUE;
|
||||
}
|
||||
if ((len >= strlen("githash")) && !case_insensitive_comp(opt, "githash")) {
|
||||
if ((len >= strlen("githash"))
|
||||
&& !case_insensitive_comp(opt, "githash")) {
|
||||
Strcpy(githash, strval);
|
||||
havehash = TRUE;
|
||||
}
|
||||
@@ -1308,7 +1311,24 @@ void
|
||||
do_options()
|
||||
{
|
||||
const char *optline;
|
||||
int infocontext = 0;
|
||||
int i, infocontext = 0;
|
||||
const char *lua_info[] = {
|
||||
"NetHack 3.7.* uses the 'Lua' interpreter to process some data:\n",
|
||||
" About Lua: Copyright (c) 1994-2017 Lua.org, PUC-Rio.\n",
|
||||
/* 1 2 3 4 5 6 7
|
||||
1234567890123456789012345678901234567890123456789012345678901234567890123456
|
||||
*/
|
||||
" \"Permission is hereby granted, free of charge, to any person obtaining",
|
||||
" a copy of this software and associated documentation files (the ",
|
||||
" \"Software\"), to deal in the Software without restriction including",
|
||||
" without limitation the rights to use, copy, modify, merge, publish,",
|
||||
" distribute, sublicense, and/or sell copies of the Software, and to ",
|
||||
" permit persons to whom the Software is furnished to do so, subject to",
|
||||
" the following conditions:",
|
||||
" The above copyright notice and this permission notice shall be",
|
||||
" included in all copies or substantial portions of the Software.\"",
|
||||
(const char *) 0
|
||||
};
|
||||
|
||||
windowing_sanity();
|
||||
filename[0] = '\0';
|
||||
@@ -1320,7 +1340,9 @@ do_options()
|
||||
perror(filename);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while ((optline = do_runtime_info(&infocontext)))
|
||||
while ((optline = do_runtime_info(&infocontext)) != 0)
|
||||
Fprintf(ofp, "%s\n", optline);
|
||||
for (i = 0; (optline = lua_info[i]) != 0; ++i)
|
||||
Fprintf(ofp, "%s\n", optline);
|
||||
Fclose(ofp);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user