[nethack] 05/31: Refresh patches for 3.6.0
James Cowgill
jcowgill-guest at moszumanska.debian.org
Mon Mar 7 17:54:18 UTC 2016
This is an automated email from the git hooks/post-receive script.
jcowgill-guest pushed a commit to branch master
in repository nethack.
commit 896c692873645ab771b8d2d67ef728b71f3b4122
Author: James Cowgill <james410 at cowgill.org.uk>
Date: Mon Mar 7 14:44:51 2016 +0000
Refresh patches for 3.6.0
---
...re-the-user-calling-recover-owns-the-file.patch | 95 ++++---
...s-in-the-default-manpage-to-what-is-used-.patch | 10 +-
.../0004-Add-LISP-based-windowing-system.patch | 41 ++--
debian/patches/0005-Simple-mail.patch | 272 +++++++++------------
...6-Common-config.h-for-all-binary-packages.patch | 121 ++++-----
...-bit-more-useful-with-recover-s-error-mes.patch | 140 ++++++-----
...share-pixmaps-nethack-for-pretty-pictures.patch | 38 +--
debian/patches/0009-Better-way-to-do-it.patch | 22 +-
...les-color-HP-monitor-for-textmode-NetHack.patch | 184 ++++++--------
...and-Linux-specifics-defined-in-unixconf.h.patch | 188 ++++----------
.../0018-lisp-support-in-src-Makefile.patch | 16 +-
debian/patches/0019-stay-in-array-bounds.patch | 20 +-
12 files changed, 481 insertions(+), 666 deletions(-)
diff --git a/debian/patches/0001-Make-sure-the-user-calling-recover-owns-the-file.patch b/debian/patches/0001-Make-sure-the-user-calling-recover-owns-the-file.patch
index 3feb5dc..c0ebef3 100644
--- a/debian/patches/0001-Make-sure-the-user-calling-recover-owns-the-file.patch
+++ b/debian/patches/0001-Make-sure-the-user-calling-recover-owns-the-file.patch
@@ -7,8 +7,6 @@ Subject: Make sure the user calling recover owns the file.
util/recover.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 46 insertions(+), 2 deletions(-)
-diff --git a/util/recover.c b/util/recover.c
-index cc1b819..5bb9f2f 100644
--- a/util/recover.c
+++ b/util/recover.c
@@ -16,6 +16,12 @@
@@ -22,35 +20,36 @@ index cc1b819..5bb9f2f 100644
+#endif
+
#ifdef VMS
- extern int FDECL(vms_creat, (const char *,unsigned));
- extern int FDECL(vms_open, (const char *,int,unsigned));
-@@ -107,15 +113,23 @@ char *argv[];
- }
+ extern int FDECL(vms_creat, (const char *, unsigned));
+ extern int FDECL(vms_open, (const char *, int, unsigned));
+@@ -112,15 +118,23 @@ char *argv[];
+ }
#if defined(SECURE) && !defined(VMS)
- if (dir
--# ifdef HACKDIR
+ if (dir
+-#ifdef HACKDIR
+# ifdef VAR_PLAYGROUND
-+ && strcmp(dir, VAR_PLAYGROUND)
++ && strcmp(dir, VAR_PLAYGROUND)
+# else
+# ifdef HACKDIR
- && strcmp(dir, HACKDIR)
--# endif
-+# endif
+ && strcmp(dir, HACKDIR)
+-#endif
+- ) {
++# endif
+# endif /* VAR_PLAYGROUND */
- ) {
- (void) setgid(getgid());
- (void) setuid(getuid());
- }
- #endif /* SECURE && !VMS */
++ ) {
+ (void) setgid(getgid());
+ (void) setuid(getuid());
+ }
+ #endif /* SECURE && !VMS */
+#ifdef VAR_PLAYGROUND
-+ if (!dir) dir = VAR_PLAYGROUND;
++ if (!dir) dir = VAR_PLAYGROUND;
+#endif
+
#ifdef HACKDIR
- if (!dir) dir = HACKDIR;
- #endif
-@@ -158,11 +172,19 @@ int lev;
+ if (!dir)
+ dir = HACKDIR;
+@@ -166,11 +180,19 @@ int lev;
#endif
}
@@ -62,47 +61,47 @@ index cc1b819..5bb9f2f 100644
open_levelfile(lev)
int lev;
{
- int fd;
+ int fd;
+#ifdef SECURE
-+ struct stat level_stat;
-+ uid_t uid;
++ struct stat level_stat;
++ uid_t uid;
+#endif
- set_levelfile_name(lev);
+ set_levelfile_name(lev);
#if defined(MICRO) || defined(WIN32) || defined(MSDOS)
-@@ -170,6 +192,21 @@ int lev;
+@@ -178,6 +200,21 @@ int lev;
#else
- fd = open(lock, O_RDONLY, 0);
+ fd = open(lock, O_RDONLY, 0);
#endif
-+ /* Security check: does the user calling recover own the file? */
++ /* Security check: does the user calling recover own the file? */
+#ifdef SECURE
-+ if (fd != -1) {
-+ uid = getuid();
-+ if (fstat(fd, &level_stat) == -1) {
-+ Fprintf(stderr, "No permission to stat level file %s.\n", lock);
-+ return -1;
-+ }
-+ if (uid != 0 && level_stat.st_uid != uid) {
-+ Fprintf(stderr, "You are not the owner of level file %s.\n", lock);
-+ return -1;
-+ }
-+ save_uid = level_stat.st_uid;
-+ }
++ if (fd != -1) {
++ uid = getuid();
++ if (fstat(fd, &level_stat) == -1) {
++ Fprintf(stderr, "No permission to stat level file %s.\n", lock);
++ return -1;
++ }
++ if (uid != 0 && level_stat.st_uid != uid) {
++ Fprintf(stderr, "You are not the owner of level file %s.\n", lock);
++ return -1;
++ }
++ save_uid = level_stat.st_uid;
++ }
+#endif
- return fd;
+ return fd;
}
-@@ -183,6 +220,13 @@ create_savefile()
+@@ -191,6 +228,13 @@ create_savefile()
#else
- fd = creat(savename, FCMASK);
+ fd = creat(savename, FCMASK);
#endif
+
+#ifdef SECURE
-+ if (fchown(fd, save_uid, -1) == -1) {
-+ Fprintf(stderr, "could not chown %s to %i!\n", savename,
-+ save_uid);
-+ }
++ if (fchown(fd, save_uid, -1) == -1) {
++ Fprintf(stderr, "could not chown %s to %i!\n", savename,
++ save_uid);
++ }
+#endif
- return fd;
+ return fd;
}
diff --git a/debian/patches/0002-Change-paths-in-the-default-manpage-to-what-is-used-.patch b/debian/patches/0002-Change-paths-in-the-default-manpage-to-what-is-used-.patch
index 055426b..29548f2 100644
--- a/debian/patches/0002-Change-paths-in-the-default-manpage-to-what-is-used-.patch
+++ b/debian/patches/0002-Change-paths-in-the-default-manpage-to-what-is-used-.patch
@@ -8,11 +8,9 @@ Subject: Change paths in the default manpage to what is used in Debian +
doc/nethack.6 | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
-diff --git a/doc/nethack.6 b/doc/nethack.6
-index 7bc2f94..63ebf40 100644
--- a/doc/nethack.6
+++ b/doc/nethack.6
-@@ -108,9 +108,10 @@ Because the option list can be very long (particularly when specifying
+@@ -112,9 +112,10 @@ Because the option list can be very long
graphics characters), options may also be included in a configuration
file.
The default is located in your home directory and
@@ -26,7 +24,7 @@ index 7bc2f94..63ebf40 100644
The configuration file's location may be specified by setting NETHACKOPTIONS
to a string consisting of an @ character followed by the filename.
.PP
-@@ -197,7 +198,7 @@ option, which must be the first argument if it appears,
+@@ -201,7 +202,7 @@ option, which must be the first argument
supplies a directory which is to serve as the playground.
It overrides the value from NETHACKDIR, HACKDIR,
or the directory specified by the game administrator during compilation
@@ -35,7 +33,7 @@ index 7bc2f94..63ebf40 100644
This option is usually only useful to the game administrator.
The playground must contain several auxiliary files such as help files,
the list of top scorers, and a subdirectory
-@@ -222,7 +223,7 @@ development by the Usenet. Andries Brouwer has made this request for the
+@@ -226,7 +227,7 @@ development by the Usenet. Andries Brou
distinction, as he may eventually release a new version of his own.
.SH FILES
.PP
@@ -44,7 +42,7 @@ index 7bc2f94..63ebf40 100644
If DLB was defined during the compile, the data files and special levels
will be inside a larger file, normally nhdat, instead of being separate
files.
-@@ -283,7 +284,7 @@ MAIL Mailbox file.
+@@ -287,7 +288,7 @@ MAIL Mailbox file.
.br
MAILREADER Replacement for default reader
.br
diff --git a/debian/patches/0004-Add-LISP-based-windowing-system.patch b/debian/patches/0004-Add-LISP-based-windowing-system.patch
index 8a78d9f..9ca34f4 100644
--- a/debian/patches/0004-Add-LISP-based-windowing-system.patch
+++ b/debian/patches/0004-Add-LISP-based-windowing-system.patch
@@ -14,9 +14,6 @@ Subject: Add LISP-based windowing system
create mode 100644 win/lisp/ChangeLog
create mode 100644 win/lisp/winlisp.c
-diff --git a/include/winlisp.h b/include/winlisp.h
-new file mode 100644
-index 0000000..f1815b7
--- /dev/null
+++ b/include/winlisp.h
@@ -0,0 +1,70 @@
@@ -90,13 +87,11 @@ index 0000000..f1815b7
+E void FDECL(lisp_outrip, (winid,int));
+
+#endif /* WINLISP_H */
-diff --git a/src/windows.c b/src/windows.c
-index 3c59080..d65710c 100644
--- a/src/windows.c
+++ b/src/windows.c
-@@ -40,6 +40,10 @@ extern struct window_procs Gnome_procs;
- #ifdef MSWIN_GRAPHICS
- extern struct window_procs mswin_procs;
+@@ -54,6 +54,10 @@ extern struct chain_procs trace_procs;
+ extern void FDECL(trace_procs_init, (int));
+ extern void *FDECL(trace_procs_chain, (int, int, void *, void *, void *));
#endif
+#ifdef LISP_GRAPHICS
+#include "winlisp.h"
@@ -105,19 +100,16 @@ index 3c59080..d65710c 100644
STATIC_DCL void FDECL(def_raw_print, (const char *s));
-@@ -81,6 +85,9 @@ struct win_choices {
+@@ -108,6 +112,9 @@ static struct win_choices {
#ifdef MSWIN_GRAPHICS
- { &mswin_procs, 0 },
+ { &mswin_procs, 0 CHAINR(0) },
#endif
+#ifdef LISP_GRAPHICS
-+ { &lisp_procs, win_lisp_init },
++ { &lisp_procs, win_lisp_init CHAINR(0) },
+#endif
- { 0, 0 } /* must be last */
- };
-
-diff --git a/win/lisp/ChangeLog b/win/lisp/ChangeLog
-new file mode 100644
-index 0000000..8686f14
+ #ifdef WINCHAIN
+ { &chainin_procs, chainin_procs_init, chainin_procs_chain },
+ { (struct window_procs *) &chainout_procs, chainout_procs_init,
--- /dev/null
+++ b/win/lisp/ChangeLog
@@ -0,0 +1,326 @@
@@ -447,9 +439,6 @@ index 0000000..8686f14
+ s/nethack-api-updated-inventory/nethack-api-update-inventory/
+ (WINLISP_VOID_RETVAL): added macro, called for every void
+ function.
-diff --git a/win/lisp/winlisp.c b/win/lisp/winlisp.c
-new file mode 100644
-index 0000000..290a457
--- /dev/null
+++ b/win/lisp/winlisp.c
@@ -0,0 +1,1937 @@
@@ -2390,13 +2379,11 @@ index 0000000..290a457
+ lisp_int (u.ugold);
+ lisp_string ("Died while trying to finish nethack-el."));
+}
-diff --git a/win/tty/termcap.c b/win/tty/termcap.c
-index 706e203..00014d0 100644
--- a/win/tty/termcap.c
+++ b/win/tty/termcap.c
-@@ -1164,6 +1164,11 @@ int color;
- if (windowprocs.name != NULL &&
- !strcmpi(windowprocs.name, "Gem")) return TRUE;
+@@ -1260,6 +1260,11 @@ int color;
+ if (windowprocs.name != NULL && !strcmpi(windowprocs.name, "Gem"))
+ return TRUE;
#endif
+#ifdef LISP_GRAPHICS
+ /* XXX has_color() should be added to windowprocs */
@@ -2404,5 +2391,5 @@ index 706e203..00014d0 100644
+ !strcmpi(windowprocs.name, "lisp")) return TRUE;
+#endif
#ifdef QT_GRAPHICS
- /* XXX has_color() should be added to windowprocs */
- if (windowprocs.name != NULL &&
+ /* XXX has_color() should be added to windowprocs */
+ if (windowprocs.name != NULL && !strcmpi(windowprocs.name, "Qt"))
diff --git a/debian/patches/0005-Simple-mail.patch b/debian/patches/0005-Simple-mail.patch
index 79db7e3..b5eb2cb 100644
--- a/debian/patches/0005-Simple-mail.patch
+++ b/debian/patches/0005-Simple-mail.patch
@@ -11,13 +11,11 @@ Subject: Simple mail
sys/unix/unixmain.c | 10 +++++-
5 files changed, 99 insertions(+), 15 deletions(-)
-diff --git a/include/decl.h b/include/decl.h
-index 76f9533..ab650d3 100644
--- a/include/decl.h
+++ b/include/decl.h
-@@ -385,6 +385,10 @@ struct autopickup_exception {
- };
- #endif /* AUTOPICKUP_EXCEPTIONS */
+@@ -413,6 +413,10 @@ E struct plinemsg_type *plinemsg_types;
+ E char *ARGV0;
+ #endif
+#ifdef SIMPLE_MAIL
+E int mailckfreq;
@@ -26,34 +24,28 @@ index 76f9533..ab650d3 100644
#undef E
#endif /* DECL_H */
-diff --git a/include/flag.h b/include/flag.h
-index 1807a0b..de149ff 100644
--- a/include/flag.h
+++ b/include/flag.h
-@@ -175,6 +175,9 @@ struct instance_flags {
- uchar bouldersym; /* symbol for boulder display */
- boolean travel1; /* first travel step */
- coord travelcc; /* coordinates for travel_cache */
+@@ -179,6 +179,9 @@ struct instance_flags {
+ int override_ID; /* true to force full identification of objects */
+ int suppress_price; /* controls doname() for unpaid objects */
+ coord travelcc; /* coordinates for travel_cache */
+#ifdef SIMPLE_MAIL
-+ boolean simplemail; /* simple mail format $NAME:$MESSAGE */
++ boolean simplemail; /* simple mail format $NAME:$MESSAGE */
+#endif
- #ifdef WIZARD
- boolean sanity_check; /* run sanity checks */
- boolean mon_polycontrol; /* debug: control monster polymorphs */
-diff --git a/include/unixconf.h b/include/unixconf.h
-index fe1b006..414938a 100644
+ boolean window_inited; /* true if init_nhwindows() completed */
+ boolean vision_inited; /* true if vision is ready */
+ boolean sanity_check; /* run sanity checks */
--- a/include/unixconf.h
+++ b/include/unixconf.h
-@@ -193,7 +193,6 @@
- # endif
+@@ -188,7 +188,6 @@
+ #endif
#endif
--#define MAILCKFREQ 50
- #endif /* MAIL */
-
+-#define MAILCKFREQ 50
+ #endif /* MAIL */
-diff --git a/src/mail.c b/src/mail.c
-index 99d7637..9b1e4f6 100644
+ /*
--- a/src/mail.c
+++ b/src/mail.c
@@ -5,6 +5,8 @@
@@ -65,168 +57,140 @@ index 99d7637..9b1e4f6 100644
#include "mail.h"
/*
-@@ -36,6 +38,8 @@ STATIC_DCL boolean FDECL(md_stop,(coord *, coord *));
- STATIC_DCL boolean FDECL(md_rush,(struct monst *,int,int));
+@@ -37,6 +39,8 @@ STATIC_DCL boolean FDECL(md_stop, (coord
+ STATIC_DCL boolean FDECL(md_rush, (struct monst *, int, int));
STATIC_DCL void FDECL(newmail, (struct mail_info *));
+int mailckfreq = 0;
+
- extern char *viz_rmin, *viz_rmax; /* line-of-sight limits (vision.c) */
+ extern char *viz_rmin, *viz_rmax; /* line-of-sight limits (vision.c) */
- #ifdef OVL0
-@@ -464,11 +468,15 @@ struct obj *otmp;
+ #if !defined(UNIX) && !defined(VMS)
+@@ -467,11 +471,15 @@ struct obj *otmp;
void
ckmailstatus()
{
+- if (!mailbox || u.uswallow || !flags.biff
+-#ifdef MAILCKFREQ
+- || moves < laststattime + MAILCKFREQ
+#ifdef SIMPLE_MAIL
-+ if (mailckfreq == 0)
-+ mailckfreq = (iflags.simplemail ? 5 : 10);
++ if (mailckfreq == 0)
++ mailckfreq = (iflags.simplemail ? 5 : 10);
+#else
-+ mailckfreq = 10;
-+#endif
++ mailckfreq = 10;
+ #endif
+- )
+
- if(!mailbox || u.uswallow || !flags.biff
--# ifdef MAILCKFREQ
-- || moves < laststattime + MAILCKFREQ
--# endif
-- )
-+ || moves < laststattime + mailckfreq)
- return;
++ if (!mailbox || u.uswallow || !flags.biff
++ || moves < laststattime + mailckfreq)
+ return;
- laststattime = moves;
-@@ -501,9 +509,68 @@ void
+ laststattime = moves;
+@@ -504,9 +512,68 @@ void
readmail(otmp)
struct obj *otmp;
{
--# ifdef DEF_MAILREADER /* This implies that UNIX is defined */
+-#ifdef DEF_MAILREADER /* This implies that UNIX is defined */
+#ifdef DEF_MAILREADER
- register const char *mr = 0;
+ register const char *mr = 0;
+#endif /* DEF_MAILREADER */
+#ifdef SIMPLE_MAIL
-+ if (iflags.simplemail)
-+ {
-+ FILE* mb = fopen(mailbox, "r");
-+ char curline[102], *msg;
-+ boolean seen_one_already = FALSE;
-+ struct flock fl = { 0 };
-+
-+ fl.l_type = F_RDLCK;
-+ fl.l_whence = SEEK_SET;
-+ fl.l_start = 0;
-+ fl.l_len = 0;
-+
-+ if (!mb)
-+ goto bail;
-+
-+ /* Allow this call to block. */
-+ if (fcntl (fileno (mb), F_SETLKW, &fl) == -1)
-+ goto bail;
-+
-+ errno = 0;
-+
-+ while (fgets(curline, 102, mb) != NULL)
-+ {
-+ fl.l_type = F_UNLCK;
-+ fcntl (fileno(mb), F_UNLCK, &fl);
-+
-+ pline("There is a%s message on this scroll.",
-+ seen_one_already ? "nother" : "");
-+
-+ msg = strchr(curline, ':');
-+
-+ if (!msg)
-+ goto bail;
-+
-+ *msg = '\0';
-+ msg++;
-+
-+ pline ("This message is from '%s'.", curline);
-+
-+ msg[strlen(msg) - 1] = '\0'; /* kill newline */
-+ pline ("It reads: \"%s\".", msg);
-+
-+ seen_one_already = TRUE;
-+ errno = 0;
-+
-+ fl.l_type = F_RDLCK;
-+ fcntl(fileno(mb), F_SETLKW, &fl);
-+ }
-
-+ fl.l_type = F_UNLCK;
-+ fcntl(fileno(mb), F_UNLCK, &fl);
-+
-+ fclose(mb);
-+ unlink(mailbox);
-+ return;
-+ }
-+# endif /* SIMPLE_MAIL */
-+# ifdef DEF_MAILREADER /* This implies that UNIX is defined */
- display_nhwindow(WIN_MESSAGE, FALSE);
- if(!(mr = nh_getenv("MAILREADER")))
- mr = DEF_MAILREADER;
-@@ -512,15 +579,21 @@ struct obj *otmp;
- (void) execl(mr, mr, (char *)0);
- terminate(EXIT_FAILURE);
- }
--# else
--# ifndef AMS /* AMS mailboxes are directories */
-+# else
-+# ifndef AMS /* AMS mailboxes are directories */
- display_file(mailbox, TRUE);
--# endif /* AMS */
--# endif /* DEF_MAILREADER */
-+# endif /* AMS */
-+# endif /* DEF_MAILREADER */
++ if (iflags.simplemail)
++ {
++ FILE* mb = fopen(mailbox, "r");
++ char curline[102], *msg;
++ boolean seen_one_already = FALSE;
++ struct flock fl = { 0 };
++
++ fl.l_type = F_RDLCK;
++ fl.l_whence = SEEK_SET;
++ fl.l_start = 0;
++ fl.l_len = 0;
++
++ if (!mb)
++ goto bail;
++
++ /* Allow this call to block. */
++ if (fcntl (fileno (mb), F_SETLKW, &fl) == -1)
++ goto bail;
++
++ errno = 0;
++
++ while (fgets(curline, 102, mb) != NULL)
++ {
++ fl.l_type = F_UNLCK;
++ fcntl (fileno(mb), F_UNLCK, &fl);
++
++ pline("There is a%s message on this scroll.",
++ seen_one_already ? "nother" : "");
++
++ msg = strchr(curline, ':');
- /* get new stat; not entirely correct: there is a small time
- window where we do not see new mail */
- getmailstatus();
-+ return;
++ if (!msg)
++ goto bail;
++
++ *msg = '\0';
++ msg++;
++
++ pline ("This message is from '%s'.", curline);
++
++ msg[strlen(msg) - 1] = '\0'; /* kill newline */
++ pline ("It reads: \"%s\".", msg);
++
++ seen_one_already = TRUE;
++ errno = 0;
++
++ fl.l_type = F_RDLCK;
++ fcntl(fileno(mb), F_SETLKW, &fl);
++ }
++
++ fl.l_type = F_UNLCK;
++ fcntl(fileno(mb), F_UNLCK, &fl);
++
++ fclose(mb);
++ unlink(mailbox);
++ return;
++ }
++#endif /* SIMPLE_MAIL */
++#ifdef DEF_MAILREADER /* This implies that UNIX is defined */
+ display_nhwindow(WIN_MESSAGE, FALSE);
+ if (!(mr = nh_getenv("MAILREADER")))
+ mr = DEF_MAILREADER;
+@@ -524,6 +591,12 @@ struct obj *otmp;
+ /* get new stat; not entirely correct: there is a small time
+ window where we do not see new mail */
+ getmailstatus();
++ return;
+
+#ifdef SIMPLE_MAIL
+bail:
-+ pline("It appears to be all gibberish."); /* bail out _professionally_ */
++ pline("It appears to be all gibberish."); /* bail out _professionally_ */
+#endif
}
- # endif /* UNIX */
-@@ -587,10 +660,7 @@ ckmailstatus()
- static int laststattime = 0;
-
- if(u.uswallow || !flags.biff
--# ifdef MAILCKFREQ
-- || moves < laststattime + MAILCKFREQ
--# endif
-- )
-+ || moves < laststattime + mailckfreq)
- return;
-
- laststattime = moves;
-diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c
-index a13514f..f88c2e1 100644
+ #endif /* UNIX */
--- a/sys/unix/unixmain.c
+++ b/sys/unix/unixmain.c
-@@ -54,7 +54,9 @@ char *argv[];
- register char *dir;
+@@ -55,6 +55,9 @@ char *argv[];
#endif
- boolean exact_username;
--
+ boolean exact_username;
+ boolean resuming = FALSE; /* assume new game */
+#ifdef SIMPLE_MAIL
-+ char* e_simple = NULL;
++ char* e_simple = NULL;
+#endif
- #if defined(__APPLE__)
- /* special hack to change working directory to a resource fork when
- running from finder --sam */
-@@ -84,6 +86,12 @@ char *argv[];
- }
+
+ sys_early_init();
+
+@@ -90,6 +93,12 @@ char *argv[];
+ }
#endif
+#ifdef SIMPLE_MAIL
-+ /* figure this out early */
-+ e_simple = nh_getenv("SIMPLEMAIL");
-+ iflags.simplemail = (e_simple ? 1 : 0);
++ /* figure this out early */
++ e_simple = nh_getenv("SIMPLEMAIL");
++ iflags.simplemail = (e_simple ? 1 : 0);
+#endif
+
- hname = argv[0];
- hackpid = getpid();
- (void) umask(0777 & ~FCMASK);
+ hname = argv[0];
+ hackpid = getpid();
+ (void) umask(0777 & ~FCMASK);
diff --git a/debian/patches/0006-Common-config.h-for-all-binary-packages.patch b/debian/patches/0006-Common-config.h-for-all-binary-packages.patch
index a43a8f5..c0243bf 100644
--- a/debian/patches/0006-Common-config.h-for-all-binary-packages.patch
+++ b/debian/patches/0006-Common-config.h-for-all-binary-packages.patch
@@ -9,17 +9,18 @@ Subject: Common config.h for all binary packages.
--- a/include/config.h
+++ b/include/config.h
-@@ -42,12 +42,19 @@
+@@ -40,6 +40,8 @@
* Define all of those you want supported in your binary.
* Some combinations make no sense. See the installation document.
*/
+
+#ifndef LISP_GRAPHICS
- #define TTY_GRAPHICS /* good old tty based graphics */
- /* #define X11_GRAPHICS */ /* X11 interface */
- /* #define QT_GRAPHICS */ /* Qt interface */
- /* #define GNOME_GRAPHICS */ /* Gnome interface */
- /* #define MSWIN_GRAPHICS */ /* Windows NT, CE, Graphics */
+ #if !defined(NOTTYGRAPHICS)
+ #define TTY_GRAPHICS /* good old tty based graphics */
+ #endif
+@@ -48,6 +50,11 @@
+ /* #define GNOME_GRAPHICS */ /* Gnome interface */
+ /* #define MSWIN_GRAPHICS */ /* Windows NT, CE, Graphics */
+/* Debian default window system is always tty; they have to set their
+ * own if they want another one (or just use the scripts */
@@ -29,103 +30,73 @@ Subject: Common config.h for all binary packages.
/*
* Define the default window system. This should be one that is compiled
* into your system (see defines above). Known window systems are:
-@@ -83,11 +90,7 @@
- #endif
-
- #ifdef QT_GRAPHICS
--# define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say wc_ascii_map */
- # define USER_SOUNDS /* Use sounds */
--# ifndef __APPLE__
--# define USER_SOUNDS_REGEX
--# endif
- # define USE_XPM /* Use XPM format for images (required) */
- # define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */
- # ifndef DEFAULT_WINDOW_SYS
-@@ -126,7 +129,7 @@
+@@ -125,7 +132,7 @@
* would allow:
* xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 >x11tiles_big.xpm
*/
--/* # define USE_XPM */ /* Disable if you do not have the XPM library */
-+# define USE_XPM /* Disable if you do not have the XPM library */
- # ifdef USE_XPM
- # define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */
- # endif
-@@ -143,16 +146,15 @@
-
- #ifndef WIZARD /* allow for compile-time or Makefile changes */
- # ifndef KR1ED
--# define WIZARD "wizard" /* the person allowed to use the -D option */
-+# define WIZARD "root" /* the person allowed to use the -D option */
- # else
- # define WIZARD
--# define WIZARD_NAME "wizard"
-+# define WIZARD_NAME "root"
- # endif
+-/* # define USE_XPM */ /* Disable if you do not have the XPM library */
++#define USE_XPM /* Disable if you do not have the XPM library */
+ #ifdef USE_XPM
+ #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */
#endif
-
- #define LOGFILE "logfile" /* larger file for debugging purposes */
- #define NEWS "news" /* the file containing the latest hack news */
--#define PANICLOG "paniclog" /* log of panic and impossible events */
+@@ -204,7 +211,6 @@
+ #define LOGFILE "logfile" /* larger file for debugging purposes */
+ #define XLOGFILE "xlogfile" /* even larger logfile */
+ #define NEWS "news" /* the file containing the latest hack news */
+-#define PANICLOG "paniclog" /* log of panic and impossible events */
/*
- * If COMPRESS is defined, it should contain the full path name of your
-@@ -169,11 +171,8 @@
+ * PERSMAX, POINTSMIN, ENTRYMAX, PERS_IS_UID:
+@@ -250,11 +256,8 @@
- #ifdef UNIX
+ #if defined(UNIX) && !defined(ZLIB_COMP) && !defined(COMPRESS)
/* path and file name extension for compression program */
--#define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
--#define COMPRESS_EXTENSION ".Z" /* compress's extension */
+-#define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
+-#define COMPRESS_EXTENSION ".Z" /* compress's extension */
-/* An example of one alternative you might want to use: */
--/* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */
--/* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */
-+#define COMPRESS "/bin/gzip" /* FSF gzip compression */
-+#define COMPRESS_EXTENSION ".gz" /* normal gzip extension */
+-/* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */
+-/* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */
++#define COMPRESS "/bin/gzip" /* FSF gzip compression */
++#define COMPRESS_EXTENSION ".gz" /* normal gzip extension */
#endif
#ifndef COMPRESS
-@@ -185,7 +184,7 @@
- * a tar-like file, thus making a neater installation. See *conf.h
- * for detailed configuration.
+@@ -298,7 +301,7 @@
+ * a tar-like file, thus making a neater installation. See *conf.h
+ * for detailed configuration.
*/
--/* #define DLB */ /* not supported on all platforms */
+-/* #define DLB */ /* not supported on all platforms */
+#define DLB /* not supported on all platforms */
/*
- * Defining INSURANCE slows down level changes, but allows games that
-@@ -204,7 +203,7 @@
+ * Defining INSURANCE slows down level changes, but allows games that
+@@ -317,7 +320,7 @@
* otherwise it will be the current directory.
*/
- # ifndef HACKDIR
--# define HACKDIR "/usr/games/lib/nethackdir"
-+# define HACKDIR "/usr/lib/games/nethack"
- # endif
+ #ifndef HACKDIR
+-#define HACKDIR "/usr/games/lib/nethackdir"
++#define HACKDIR "/usr/lib/games/nethack"
+ #endif
/*
-@@ -214,7 +213,9 @@
+@@ -327,7 +330,9 @@
* since the user might create files in a directory of his choice.
* Of course SECURE is meaningful only if HACKDIR is defined.
*/
--/* #define SECURE */ /* do setuid(getuid()) after chdir() */
-+#define SECURE /* do setuid(getuid()) after chdir() */
+-/* #define SECURE */ /* do setuid(getuid()) after chdir() */
++#define SECURE /* do setuid(getuid()) after chdir() */
+#define PIXMAPDIR "/usr/share/pixmaps/nethack/"
+#define SIMPLE_MAIL
/*
* If it is desirable to limit the number of people that can play Hack
-@@ -338,6 +339,7 @@
- #endif
+@@ -453,6 +458,9 @@ typedef unsigned char uchar;
+ but it isn't necessary for successful operation of the program */
+ #define FREE_ALL_MEMORY /* free all memory at exit */
- #define EXP_ON_BOTL /* Show experience on bottom line */
++/* Paranoid confirmation when hitting peacefuls */
+#define PARANOID
- /* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson at ucivax) */
-
- /*
-@@ -349,7 +351,7 @@
- */
-
- /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */
--/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
-+#define AUTOPICKUP_EXCEPTIONS /* exceptions to autopickup */
-
- /* End of Section 5 */
++
+ /* End of Section 4 */
+ #include "global.h" /* Define everything else according to choices above */
diff --git a/debian/patches/0007-Be-a-little-bit-more-useful-with-recover-s-error-mes.patch b/debian/patches/0007-Be-a-little-bit-more-useful-with-recover-s-error-mes.patch
index e748284..2290b79 100644
--- a/debian/patches/0007-Be-a-little-bit-more-useful-with-recover-s-error-mes.patch
+++ b/debian/patches/0007-Be-a-little-bit-more-useful-with-recover-s-error-mes.patch
@@ -7,92 +7,90 @@ Subject: Be a little bit more useful with recover's error messages
util/recover.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
-diff --git a/util/recover.c b/util/recover.c
-index 5bb9f2f..183474e 100644
--- a/util/recover.c
+++ b/util/recover.c
-@@ -39,7 +39,7 @@ void FDECL(copy_bytes, (int,int));
- #define Fprintf (void)nhce_message
- static void nhce_message(FILE*, const char*, ...);
+@@ -39,7 +39,7 @@ void FDECL(copy_bytes, (int, int));
+ #define Fprintf (void) nhce_message
+ static void nhce_message(FILE *, const char *, ...);
#endif
-
-+#define Perror (void)perror
- #define Close (void)close
++#define Perror (void) perror
+ #define Close (void) close
#ifdef UNIX
-@@ -65,6 +65,7 @@ extern unsigned _stklen = STKSIZ;
- #endif
- char savename[SAVESIZE]; /* holds relative path of save file from playground */
-
-+const char *dir = (char*)0;
+@@ -66,13 +66,14 @@ extern unsigned _stklen = STKSIZ;
+ char
+ savename[SAVESIZE]; /* holds relative path of save file from playground */
++const char *dir = (char*) 0;
++
int
main(argc, argv)
-@@ -72,7 +73,6 @@ int argc;
+ int argc;
char *argv[];
{
- int argno;
-- const char *dir = (char *)0;
+ int argno;
+- const char *dir = (char *) 0;
#ifdef AMIGA
- char *startdir = (char *)0;
+ char *startdir = (char *) 0;
#endif
-@@ -138,7 +138,8 @@ char *argv[];
- startdir = getcwd(0,255);
+@@ -144,7 +145,8 @@ char *argv[];
+ startdir = getcwd(0, 255);
#endif
- if (dir && chdir((char *) dir) < 0) {
-- Fprintf(stderr, "%s: cannot chdir to %s.\n", argv[0], dir);
-+ Fprintf(stderr, "%s: cannot chdir:", argv[0]);
-+ Perror(dir);
- exit(EXIT_FAILURE);
- }
+ if (dir && chdir((char *) dir) < 0) {
+- Fprintf(stderr, "%s: cannot chdir to %s.\n", argv[0], dir);
++ Fprintf(stderr, "%s: cannot chdir:", argv[0]);
++ Perror(dir);
+ exit(EXIT_FAILURE);
+ }
-@@ -275,7 +276,9 @@ char *basename;
- Fprintf(stderr,
- "\nTrouble accessing level 0 (errno = %d).\n", errno);
+@@ -288,7 +290,9 @@ char *basename;
+ Fprintf(stderr, "\nTrouble accessing level 0 (errno = %d).\n",
+ errno);
#endif
-- Fprintf(stderr, "Cannot open level 0 for %s.\n", basename);
-+ Fprintf(stderr, "Cannot open level 0 for %s in directory %s: ",
-+ basename, dir);
-+ Perror(lock);
- return(-1);
- }
- if (read(gfd, (genericptr_t) &hpid, sizeof hpid) != sizeof hpid) {
-@@ -297,7 +300,8 @@ char *basename;
- != sizeof savename) ||
- (read(gfd, (genericptr_t) &version_data, sizeof version_data)
- != sizeof version_data)) {
-- Fprintf(stderr, "Error reading %s -- can't recover.\n", lock);
-+ Fprintf(stderr, "Error reading, can't recover: ");
-+ Perror(lock);
- Close(gfd);
- return(-1);
- }
-@@ -310,14 +314,16 @@ char *basename;
- */
- sfd = create_savefile();
- if (sfd < 0) {
-- Fprintf(stderr, "Cannot create savefile %s.\n", savename);
-+ Fprintf(stderr, "Cannot create savefile in %s: ", dir);
-+ Perror(savename);
- Close(gfd);
- return(-1);
- }
+- Fprintf(stderr, "Cannot open level 0 for %s.\n", basename);
++ Fprintf(stderr, "Cannot open level 0 for %s in directory %s: ",
++ basename, dir);
++ Perror(lock);
+ return (-1);
+ }
+ if (read(gfd, (genericptr_t) &hpid, sizeof hpid) != sizeof hpid) {
+@@ -315,7 +319,8 @@ char *basename;
+ || (read(gfd, (genericptr_t) &pltmpsiz, sizeof pltmpsiz)
+ != sizeof pltmpsiz) || (pltmpsiz > PL_NSIZ)
+ || (read(gfd, (genericptr_t) &plbuf, pltmpsiz) != pltmpsiz)) {
+- Fprintf(stderr, "Error reading %s -- can't recover.\n", lock);
++ Fprintf(stderr, "Error reading, can't recover: ");
++ Perror(lock);
+ Close(gfd);
+ return (-1);
+ }
+@@ -330,14 +335,16 @@ char *basename;
+ */
+ sfd = create_savefile();
+ if (sfd < 0) {
+- Fprintf(stderr, "Cannot create savefile %s.\n", savename);
++ Fprintf(stderr, "Cannot create savefile in %s: ", dir);
++ Perror(savename);
+ Close(gfd);
+ return (-1);
+ }
- lfd = open_levelfile(savelev);
- if (lfd < 0) {
-- Fprintf(stderr, "Cannot open level of save for %s.\n", basename);
-+ Fprintf(stderr, "Cannot open level of save for %s: ", basename);
-+ Perror(lock);
- Close(gfd);
- Close(sfd);
- return(-1);
-@@ -325,7 +331,8 @@ char *basename;
+ lfd = open_levelfile(savelev);
+ if (lfd < 0) {
+- Fprintf(stderr, "Cannot open level of save for %s.\n", basename);
++ Fprintf(stderr, "Cannot open level of save for %s: ", basename);
++ Perror(lock);
+ Close(gfd);
+ Close(sfd);
+ return (-1);
+@@ -345,7 +352,8 @@ char *basename;
- if (write(sfd, (genericptr_t) &version_data, sizeof version_data)
- != sizeof version_data) {
-- Fprintf(stderr, "Error writing %s; recovery failed.\n", savename);
-+ Fprintf(stderr, "Error writing, recovery failed: ");
-+ Perror(savename);
- Close(gfd);
- Close(sfd);
- return(-1);
+ if (write(sfd, (genericptr_t) &version_data, sizeof version_data)
+ != sizeof version_data) {
+- Fprintf(stderr, "Error writing %s; recovery failed.\n", savename);
++ Fprintf(stderr, "Error writing, recovery failed: ");
++ Perror(savename);
+ Close(gfd);
+ Close(sfd);
+ return (-1);
diff --git a/debian/patches/0008-Use-usr-share-pixmaps-nethack-for-pretty-pictures.patch b/debian/patches/0008-Use-usr-share-pixmaps-nethack-for-pretty-pictures.patch
index f10842b..280e097 100644
--- a/debian/patches/0008-Use-usr-share-pixmaps-nethack-for-pretty-pictures.patch
+++ b/debian/patches/0008-Use-usr-share-pixmaps-nethack-for-pretty-pictures.patch
@@ -7,22 +7,28 @@ Subject: Use /usr/share/pixmaps/nethack/ for pretty pictures.
win/X11/winX.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-diff --git a/win/X11/winX.c b/win/X11/winX.c
-index 14f0e90..1c5d49b 100644
--- a/win/X11/winX.c
+++ b/win/X11/winX.c
-@@ -919,12 +919,12 @@ static XtResource resources[] = {
- { "message_lines", "Message_lines", XtRInt, sizeof(int),
- XtOffset(AppResources *,message_lines), XtRString, "12" },
- { "pet_mark_bitmap", "Pet_mark_bitmap", XtRString, sizeof(String),
-- XtOffset(AppResources *,pet_mark_bitmap), XtRString, "pet_mark.xbm" },
-+ XtOffset(AppResources *,pet_mark_bitmap), XtRString, PIXMAPDIR "pet_mark.xbm" },
- { "pet_mark_color", "Pet_mark_color", XtRPixel, sizeof(XtRPixel),
- XtOffset(AppResources *,pet_mark_color), XtRString, "Red" },
+@@ -976,19 +976,19 @@ static XtResource resources[] = {
+ XtOffset(AppResources *, message_lines), XtRString, nhStr("12") },
+ { nhStr("pet_mark_bitmap"), nhStr("Pet_mark_bitmap"), XtRString,
+ sizeof(String), XtOffset(AppResources *, pet_mark_bitmap), XtRString,
+- nhStr("pet_mark.xbm") },
++ nhStr(PIXMAPDIR "pet_mark.xbm") },
+ { nhStr("pet_mark_color"), nhStr("Pet_mark_color"), XtRPixel,
+ sizeof(XtRPixel), XtOffset(AppResources *, pet_mark_color), XtRString,
+ nhStr("Red") },
+ { nhStr("pilemark_bitmap"), nhStr("Pilemark_bitmap"), XtRString,
+ sizeof(String), XtOffset(AppResources *, pilemark_bitmap), XtRString,
+- nhStr("pilemark.xbm") },
++ nhStr(PIXMAPDIR "pilemark.xbm") },
+ { nhStr("pilemark_color"), nhStr("Pilemark_color"), XtRPixel,
+ sizeof(XtRPixel), XtOffset(AppResources *, pilemark_color), XtRString,
+ nhStr("Green") },
#ifdef GRAPHIC_TOMBSTONE
- { "tombstone", "Tombstone", XtRString, sizeof(String),
-- XtOffset(AppResources *,tombstone), XtRString, "rip.xpm" },
-+ XtOffset(AppResources *,tombstone), XtRString, PIXMAPDIR "rip.xpm" },
- { "tombtext_x", "Tombtext_x", XtRInt, sizeof(int),
- XtOffset(AppResources *,tombtext_x), XtRString, "155" },
- { "tombtext_y", "Tombtext_y", XtRInt, sizeof(int),
+ { nhStr("tombstone"), "Tombstone", XtRString, sizeof(String),
+- XtOffset(AppResources *, tombstone), XtRString, "rip.xpm" },
++ XtOffset(AppResources *, tombstone), XtRString, PIXMAPDIR "rip.xpm" },
+ { nhStr("tombtext_x"), "Tombtext_x", XtRInt, sizeof(int),
+ XtOffset(AppResources *, tombtext_x), XtRString, "155" },
+ { nhStr("tombtext_y"), "Tombtext_y", XtRInt, sizeof(int),
diff --git a/debian/patches/0009-Better-way-to-do-it.patch b/debian/patches/0009-Better-way-to-do-it.patch
index 48c5c5f..a8a351b 100644
--- a/debian/patches/0009-Better-way-to-do-it.patch
+++ b/debian/patches/0009-Better-way-to-do-it.patch
@@ -7,25 +7,27 @@ Subject: Better way to do it.
src/windows.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
-diff --git a/src/windows.c b/src/windows.c
-index d65710c..8953269 100644
--- a/src/windows.c
+++ b/src/windows.c
-@@ -103,10 +103,16 @@ void
+@@ -206,14 +206,20 @@ void
choose_windows(s)
const char *s;
{
+ char *ow; const char *wt;
register int i;
-+
+
+ if (!strcmp(s, DEFAULT_WINDOW_SYS) && (ow = getenv("OVERRIDEWIN")))
+ wt = ow;
+ else
+ wt = s;
++
+ for (i = 0; winchoices[i].procs; i++) {
+ if ('+' == winchoices[i].procs->name[0])
+ continue;
+ if ('-' == winchoices[i].procs->name[0])
+ continue;
+- if (!strcmpi(s, winchoices[i].procs->name)) {
++ if (!strcmpi(wt, winchoices[i].procs->name)) {
+ windowprocs = *winchoices[i].procs;
- for(i=0; winchoices[i].procs; i++)
-- if (!strcmpi(s, winchoices[i].procs->name)) {
-+ if (!strcmpi(wt, winchoices[i].procs->name)) {
- windowprocs = *winchoices[i].procs;
- if (winchoices[i].ini_routine) (*winchoices[i].ini_routine)();
- return;
+ if (last_winchoice && last_winchoice->ini_routine)
diff --git a/debian/patches/0010-Enables-color-HP-monitor-for-textmode-NetHack.patch b/debian/patches/0010-Enables-color-HP-monitor-for-textmode-NetHack.patch
index a133c85..792cd06 100644
--- a/debian/patches/0010-Enables-color-HP-monitor-for-textmode-NetHack.patch
+++ b/debian/patches/0010-Enables-color-HP-monitor-for-textmode-NetHack.patch
@@ -14,11 +14,9 @@ Subject: Enables color HP monitor for textmode NetHack.
src/options.c | 3 +++
8 files changed, 74 insertions(+)
-diff --git a/dat/opthelp b/dat/opthelp
-index 4dade58..2fa5f70 100644
--- a/dat/opthelp
+++ b/dat/opthelp
-@@ -71,6 +71,9 @@ Boolean options if TEXTCOLOR was set at compile time:
+@@ -73,6 +73,9 @@ Boolean options if TEXTCOLOR was set at
color use different colors for objects on screen [TRUE for micros]
hilite_pet display pets in a highlighted manner [FALSE]
@@ -28,11 +26,9 @@ index 4dade58..2fa5f70 100644
Boolean option if TIMED_DELAY was set at compile time (tty interface only):
timed_delay on unix and VMS, use a timer instead of sending
extra screen output when attempting to pause for
-diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn
-index f67f02f..8ac033d 100644
--- a/doc/Guidebook.mn
+++ b/doc/Guidebook.mn
-@@ -1863,6 +1863,10 @@ interesting and/or important information.
+@@ -2119,6 +2119,10 @@ on the top of the pile.
.lp horsename
Name your starting horse (ex. ``horsename:Trigger'').
Cannot be set with the `O' command.
@@ -40,14 +36,12 @@ index f67f02f..8ac033d 100644
+Colors your HP reading green when you attain <= 2/3 of your total HP,
+yellow when you reach <= 1/3 of total, and red when you are at or below
+1/10 of your total HP.
- .lp IBMgraphics
- Use a predefined selection of IBM extended ASCII characters to display the
- dungeon/effects/traps instead of having to define a full graphics set
-diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex
-index f76398f..9dd0be5 100644
+ .lp ignintr
+ Ignore interrupt signals, including breaks (default off). Persistent.
+ .lp implicit_uncursed
--- a/doc/Guidebook.tex
+++ b/doc/Guidebook.tex
-@@ -2307,6 +2307,11 @@ might miss some interesting and/or important information.
+@@ -2551,6 +2551,11 @@ on the top of the pile.
Name your starting horse (ex.\ ``{\tt horsename:Trigger}'').
Cannot be set with the `{\tt O}' command.
%.lp
@@ -56,14 +50,12 @@ index f76398f..9dd0be5 100644
+yellow when you reach <= 1/3 of total, and red when you are at or below
+1/10 of your total HP.
+%.lp
- \item[\ib{IBMgraphics}]
- Use a predefined selection of IBM extended ASCII characters to display the
- dungeon/effects/traps instead of having to define a full graphics set
-diff --git a/doc/Guidebook.txt b/doc/Guidebook.txt
-index f0f9f7d..cfc0ed4 100644
+ \item[\ib{ignintr}]
+ Ignore interrupt signals, including breaks (default off). Persistent.
+ %.lp
--- a/doc/Guidebook.txt
+++ b/doc/Guidebook.txt
-@@ -2398,6 +2398,11 @@
+@@ -2686,6 +2686,11 @@
Name your starting horse (ex. ``horsename:Trigger''). Cannot
be set with the `O' command.
@@ -71,42 +63,35 @@ index f0f9f7d..cfc0ed4 100644
+ Colors your hitpoint reading green when you attain <= 2/3 of
+ your total HP, yellow when you reach <= 1/3 of total, and red
+ when you are at or below 1/10 of your total HP.
-+
- IBMgraphics
- Use a predefined selection of IBM extended ASCII characters to
- display the dungeon/effects/traps instead of having to define a
-diff --git a/include/config.h b/include/config.h
-index e2c1921..5a57195 100644
++
+ ignintr
+ Ignore interrupt signals, including breaks (default off). Per-
+ sistent.
--- a/include/config.h
+++ b/include/config.h
-@@ -340,6 +340,9 @@ typedef unsigned char uchar;
-
- #define EXP_ON_BOTL /* Show experience on bottom line */
+@@ -461,6 +461,8 @@ typedef unsigned char uchar;
+ /* Paranoid confirmation when hitting peacefuls */
#define PARANOID
-+
+
+#define HPMON /* Color HP monitor */
+
- /* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson at ucivax) */
+ /* End of Section 4 */
- /*
-diff --git a/include/flag.h b/include/flag.h
-index de149ff..ee8031b 100644
+ #include "global.h" /* Define everything else according to choices above */
--- a/include/flag.h
+++ b/include/flag.h
-@@ -219,6 +219,11 @@ struct instance_flags {
- boolean lan_mail; /* mail is initialized */
- boolean lan_mail_fetched; /* mail is awaiting display */
+@@ -261,6 +261,11 @@ struct instance_flags {
+ boolean lan_mail; /* mail is initialized */
+ boolean lan_mail_fetched; /* mail is awaiting display */
#endif
+
+#if defined(HPMON) && defined(TEXTCOLOR)
-+ boolean use_hpmon;
++ boolean use_hpmon;
+#endif
+
- /*
- * Window capability support.
- */
-diff --git a/src/botl.c b/src/botl.c
-index 6534ad7..70a2d37 100644
+ /*
+ * Window capability support.
+ */
--- a/src/botl.c
+++ b/src/botl.c
@@ -3,6 +3,7 @@
@@ -114,86 +99,75 @@ index 6534ad7..70a2d37 100644
#include "hack.h"
+#include "wintty.h"
+ #include <limits.h>
- #ifdef OVL0
- extern const char *hu_stat[]; /* defined in eat.c */
-@@ -248,6 +249,9 @@ bot2()
- char newbot2[MAXCO];
- register char *nb;
- int hp, hpmax;
+ extern const char *hu_stat[]; /* defined in eat.c */
+@@ -81,6 +82,9 @@ bot2()
+ char newbot2[MAXCO];
+ register char *nb;
+ int hp, hpmax;
+#if defined(HPMON) && !defined(LISP_GRAPHICS)
-+ int hpcolor, hpattr;
++ int hpcolor, hpattr;
+#endif
- int cap = near_capacity();
+ int cap = near_capacity();
- hp = Upolyd ? u.mh : u.uhp;
-@@ -256,6 +260,15 @@ bot2()
- if(hp < 0) hp = 0;
- (void) describe_level(newbot2);
- Sprintf(nb = eos(newbot2),
-+#ifdef HPMON
-+ "%c:%-2ld HP:", oc_syms[COIN_CLASS],
-+#ifndef GOLDOBJ
-+ u.ugold
+ hp = Upolyd ? u.mh : u.uhp;
+@@ -89,9 +93,43 @@ bot2()
+ if (hp < 0)
+ hp = 0;
+ (void) describe_level(newbot2);
+- Sprintf(nb = eos(newbot2), "%s:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d",
+- encglyph(objnum_to_glyph(GOLD_PIECE)), money_cnt(invent), hp,
+- hpmax, u.uen, u.uenmax, u.uac);
++ Sprintf(nb = eos(newbot2), "%s:%-2ld HP:",
++ encglyph(objnum_to_glyph(GOLD_PIECE)), money_cnt(invent));
++#ifndef HPMON
++ Sprintf(nb = eos(nb), "%d(%d) Pw:%d(%d) AC:%-2d",
++ hp, hpmax, u.uen, u.uenmax, u.uac);
+#else
-+ money_cnt(invent)
-+#endif
-+ );
-+#else /* HPMON */
- "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[COIN_CLASS],
- #ifndef GOLDOBJ
- u.ugold,
-@@ -263,6 +276,39 @@ bot2()
- money_cnt(invent),
- #endif
- hp, hpmax, u.uen, u.uenmax, u.uac);
-+#endif /* HPMON */
-+#ifdef HPMON
-+ curs(WIN_STATUS, 1, 1);
-+ putstr(WIN_STATUS, 0, newbot2);
++ curs(WIN_STATUS, 1, 1);
++ putstr(WIN_STATUS, 0, newbot2);
+
-+ Sprintf(nb = eos(newbot2), "%d(%d)", hp, hpmax);
++ Sprintf(nb = eos(newbot2), "%d(%d)", hp, hpmax);
+#if defined(TEXTCOLOR) && !defined(LISP_GRAPHICS)
-+ if (iflags.use_color && iflags.use_hpmon) {
-+ curs(WIN_STATUS, 1, 1);
-+ hpattr = ATR_NONE;
-+ if(hp == hpmax){
-+ hpcolor = NO_COLOR;
-+ } else if(hp > (hpmax*2/3)) {
-+ hpcolor = CLR_GREEN;
-+ } else if(hp <= (hpmax/3)) {
-+ hpcolor = CLR_RED;
-+ if(hp<=(hpmax/10))
-+ hpattr = ATR_BLINK;
-+ } else {
-+ hpcolor = CLR_YELLOW;
-+ }
-+ if (hpcolor != NO_COLOR)
-+ term_start_color(hpcolor);
-+ if(hpattr!=ATR_NONE)term_start_attr(hpattr);
-+ putstr(WIN_STATUS, hpattr, newbot2);
-+ if(hpattr!=ATR_NONE)term_end_attr(hpattr);
-+ if (hpcolor != NO_COLOR)
-+ term_end_color();
-+ }
++ if (iflags.use_color && iflags.use_hpmon) {
++ curs(WIN_STATUS, 1, 1);
++ hpattr = ATR_NONE;
++ if(hp == hpmax){
++ hpcolor = NO_COLOR;
++ } else if(hp > (hpmax*2/3)) {
++ hpcolor = CLR_GREEN;
++ } else if(hp <= (hpmax/3)) {
++ hpcolor = CLR_RED;
++ if(hp<=(hpmax/10))
++ hpattr = ATR_BLINK;
++ } else {
++ hpcolor = CLR_YELLOW;
++ }
++ if (hpcolor != NO_COLOR)
++ term_start_color(hpcolor);
++ if(hpattr!=ATR_NONE)term_start_attr(hpattr);
++ putstr(WIN_STATUS, hpattr, newbot2);
++ if(hpattr!=ATR_NONE)term_end_attr(hpattr);
++ if (hpcolor != NO_COLOR)
++ term_end_color();
++ }
+#endif /* TEXTCOLOR */
-+ Sprintf(nb = eos(newbot2), " Pw:%d(%d) AC:%-2d",
-+ u.uen, u.uenmax, u.uac);
++ Sprintf(nb = eos(newbot2), " Pw:%d(%d) AC:%-2d",
++ u.uen, u.uenmax, u.uac);
+#endif /* HPMON */
- if (Upolyd)
- Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel);
-diff --git a/src/options.c b/src/options.c
-index dfb8006..3aff6b3 100644
+ if (Upolyd)
+ Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel);
--- a/src/options.c
+++ b/src/options.c
-@@ -86,6 +86,9 @@ static struct Bool_Opt
+@@ -112,6 +112,9 @@ static struct Bool_Opt {
#else
- {"extmenu", (boolean *)0, FALSE, SET_IN_FILE},
+ { "extmenu", (boolean *) 0, FALSE, SET_IN_FILE },
#endif
+#if defined(TEXTCOLOR) && defined(HPMON)
+ { "hpmon", &iflags.use_hpmon, FALSE, SET_IN_GAME},
+#endif
#ifdef OPT_DISPMAP
- {"fast_map", &flags.fast_map, TRUE, SET_IN_GAME},
+ { "fast_map", &flags.fast_map, TRUE, SET_IN_GAME },
#else
diff --git a/debian/patches/0017-Debian-and-Linux-specifics-defined-in-unixconf.h.patch b/debian/patches/0017-Debian-and-Linux-specifics-defined-in-unixconf.h.patch
index 58edce4..c2b8176 100644
--- a/debian/patches/0017-Debian-and-Linux-specifics-defined-in-unixconf.h.patch
+++ b/debian/patches/0017-Debian-and-Linux-specifics-defined-in-unixconf.h.patch
@@ -15,161 +15,81 @@ Subject: Debian (and Linux) specifics defined in unixconf.h.
*/
/* define exactly one of the following four choices */
--/* #define BSD 1 */ /* define for 4.n/Free/Open/Net BSD */
-- /* also for relatives like SunOS 4.x, DG/UX, and */
+-/* #define BSD 1 */ /* define for 4.n/Free/Open/Net BSD */
+- /* also for relatives like SunOS 4.x, DG/UX, and */
+#if defined(__FreeBSD_kernel__)
-+#define BSD 1 /* define for 4.n/Free/Open/Net BSD */
-+#endif /* also for relatives like SunOS 4.x, DG/UX, and */
- /* older versions of Linux */
- /* #define ULTRIX */ /* define for Ultrix v3.0 or higher (but not lower) */
- /* Use BSD for < v3.0 */
-@@ -32,12 +33,14 @@
-
++#define BSD 1 /* define for 4.n/Free/Open/Net BSD */
++#endif /* also for relatives like SunOS 4.x, DG/UX, and */
+ /* older versions of Linux */
+ /* #define ULTRIX */ /* define for Ultrix v3.0 or higher (but not lower) */
+ /* Use BSD for < v3.0 */
+@@ -31,12 +32,14 @@
+ /* use SYSV for < v6.5 */
/* define any of the following that are appropriate */
--#define SVR4 /* use in addition to SYSV for System V Release 4 */
-+/* #define SVR4 */ /* use in addition to SYSV for System V Release 4 */
- /* including Solaris 2+ */
- #define NETWORK /* if running on a networked system */
- /* e.g. Suns sharing a playground through NFS */
- /* #define SUNOS4 */ /* SunOS 4.x */
--/* #define LINUX */ /* Another Unix clone */
+-#define SVR4 /* use in addition to SYSV for System V Release 4 */
++/* #define SVR4 */ /* use in addition to SYSV for System V Release 4 */
+ /* including Solaris 2+ */
+ #define NETWORK /* if running on a networked system */
+ /* e.g. Suns sharing a playground through NFS */
+ /* #define SUNOS4 */ /* SunOS 4.x */
+-/* #define LINUX */ /* Another Unix clone */
+#ifdef __linux__
-+#define LINUX /* Another Unix clone */
++#define LINUX /* Another Unix clone */
+#endif
- /* #define CYGWIN32 */ /* Unix on Win32 -- use with case sensitive defines */
- /* #define GENIX */ /* Yet Another Unix Clone */
- /* #define HISX */ /* Bull Unix for XPS Machines */
-@@ -102,7 +105,7 @@
+ /* #define CYGWIN32 */ /* Unix on Win32 -- use with case sensitive defines */
+ /* #define GENIX */ /* Yet Another Unix Clone */
+ /* #define HISX */ /* Bull Unix for XPS Machines */
+@@ -101,7 +104,7 @@
* If you want the static parts of your playground on a read-only file
* system, define VAR_PLAYGROUND to be where the variable parts are kept.
*/
-/* #define VAR_PLAYGROUND "/var/lib/games/nethack" */
+#define VAR_PLAYGROUND "/var/games/nethack"
-
/*
-@@ -132,7 +135,7 @@
+ * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
+@@ -128,7 +131,7 @@
* "extra output" method is used, but not all systems provide access to
* a fine-grained timer.
*/
--/* #define TIMED_DELAY */ /* usleep() */
-+#define TIMED_DELAY /* usleep() */
+-/* #define TIMED_DELAY */ /* usleep() */
++#define TIMED_DELAY /* usleep() */
#endif
/*
-@@ -166,12 +169,12 @@
-
- /* #define NO_MAILREADER */ /* have mail daemon just tell player of mail */
-
--#ifdef MAIL
-+#ifdef MAIL
- # if defined(BSD) || defined(ULTRIX)
- # ifdef AMS
- #define AMS_MAILBOX "/Mailbox"
- # else
--# if defined(__FreeBSD__) || defined(__OpenBSD__)
-+# if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
- #define DEF_MAILREADER "/usr/bin/mail"
- # else
- #define DEF_MAILREADER "/usr/ucb/Mail"
-@@ -189,7 +192,8 @@
- # endif
- # endif
- # else
--#define DEF_MAILREADER "/bin/mail"
+@@ -166,7 +169,7 @@
+ #ifdef AMS
+ #define AMS_MAILBOX "/Mailbox"
+ #else
+-#if defined(__FreeBSD__) || defined(__OpenBSD__)
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
+ #define DEF_MAILREADER "/usr/bin/mail"
+ #else
+ #define DEF_MAILREADER "/usr/ucb/Mail"
+@@ -184,7 +187,8 @@
+ #endif
+ #endif
+ #else
+-#define DEF_MAILREADER "/bin/mail"
+/* Debian mail reader is /usr/bin/mail, not /bin/mail */
-+#define DEF_MAILREADER "/usr/bin/mail"
- # endif
++#define DEF_MAILREADER "/usr/bin/mail"
+ #endif
#endif
--- a/src/mail.c
+++ b/src/mail.c
-@@ -72,10 +72,11 @@
- # if !defined(MAILPATH) && defined(AMS) /* Just a placeholder for AMS */
- # define MAILPATH "/dev/null"
- # endif
--# if !defined(MAILPATH) && (defined(LINUX) || defined(__osf__))
-+# if !defined(MAILPATH) && defined(__osf__)
- # define MAILPATH "/var/spool/mail/"
- # endif
--# if !defined(MAILPATH) && defined(__FreeBSD__)
+@@ -68,10 +68,11 @@ static long laststattime;
+ #if !defined(MAILPATH) && defined(AMS) /* Just a placeholder for AMS */
+ #define MAILPATH "/dev/null"
+ #endif
+-#if !defined(MAILPATH) && (defined(LINUX) || defined(__osf__))
++#if !defined(MAILPATH) && defined(__osf__)
+ #define MAILPATH "/var/spool/mail/"
+ #endif
+-#if !defined(MAILPATH) && defined(__FreeBSD__)
+/* Debian uses /var/mail, too. */
-+# if !defined(MAILPATH) && (defined(__FreeBSD__) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__))
- # define MAILPATH "/var/mail/"
- # endif
- # if !defined(MAILPATH) && (defined(BSD) || defined(ULTRIX))
---- a/util/makedefs.c
-+++ b/util/makedefs.c
-@@ -358,7 +358,7 @@
- perror(filename);
- exit(EXIT_FAILURE);
- }
-- Fprintf(ofp,Dont_Edit_Data);
-+ Fprintf(ofp, "%s", Dont_Edit_Data);
-
- Sprintf(infile, DATA_IN_TEMPLATE, RUMOR_FILE);
- Strcat(infile, ".tru");
-@@ -557,7 +557,7 @@
- exit(EXIT_FAILURE);
- }
- Fprintf(ofp,"/*\tSCCS Id: @(#)date.h\t3.4\t2002/02/03 */\n\n");
-- Fprintf(ofp,Dont_Edit_Code);
-+ Fprintf(ofp, "%s", Dont_Edit_Code);
-
- #ifdef KR1ED
- (void) time(&clocktim);
-@@ -1236,7 +1236,7 @@
- perror(filename);
- exit(EXIT_FAILURE);
- }
-- Fprintf(ofp,Dont_Edit_Data);
-+ Fprintf(ofp, "%s", Dont_Edit_Data);
-
- while (fgets(in_line, sizeof in_line, ifp) != 0) {
- SpinCursor(3);
-@@ -1358,7 +1358,7 @@
- perror(filename);
- exit(EXIT_FAILURE);
- }
-- Fprintf(ofp,Dont_Edit_Code);
-+ Fprintf(ofp,"%s", Dont_Edit_Code);
- Fprintf(ofp,"#include \"config.h\"\n");
- Fprintf(ofp,"\nconst int monstr[] = {\n");
- for (ptr = &mons[0], j = 0; ptr->mlet; ptr++) {
-@@ -1399,7 +1399,7 @@
- exit(EXIT_FAILURE);
- }
- Fprintf(ofp,"/*\tSCCS Id: @(#)pm.h\t3.4\t2002/02/03 */\n\n");
-- Fprintf(ofp,Dont_Edit_Code);
-+ Fprintf(ofp,"%s", Dont_Edit_Code);
- Fprintf(ofp,"#ifndef PM_H\n#define PM_H\n");
-
- if (strcmp(mons[0].mname, "playermon") != 0)
-@@ -1715,7 +1715,7 @@
- exit(EXIT_FAILURE);
- }
- Fprintf(ofp,"/*\tSCCS Id: @(#)onames.h\t3.4\t2002/02/03 */\n\n");
-- Fprintf(ofp,Dont_Edit_Code);
-+ Fprintf(ofp,"%s", Dont_Edit_Code);
- Fprintf(ofp,"#ifndef ONAMES_H\n#define ONAMES_H\n\n");
-
- for(i = 0; !i || objects[i].oc_class != ILLOBJ_CLASS; i++) {
-@@ -1870,7 +1870,7 @@
- perror(filename);
- exit(EXIT_FAILURE);
- }
-- Fprintf(ofp,Dont_Edit_Code);
-+ Fprintf(ofp,"%s", Dont_Edit_Code);
- Fprintf(ofp,"#ifdef VISION_TABLES\n");
- #ifdef VISION_TABLES
- H_close_gen();
-@@ -1895,7 +1895,7 @@
- Unlink(filename);
- exit(EXIT_FAILURE);
- }
-- Fprintf(ofp,Dont_Edit_Code);
-+ Fprintf(ofp,"%s", Dont_Edit_Code);
- Fprintf(ofp,"#include \"config.h\"\n");
- Fprintf(ofp,"#ifdef VISION_TABLES\n");
- Fprintf(ofp,"#include \"vis_tab.h\"\n");
++#if !defined(MAILPATH) && (defined(__FreeBSD__) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__))
+ #define MAILPATH "/var/mail/"
+ #endif
+ #if !defined(MAILPATH) && (defined(BSD) || defined(ULTRIX))
diff --git a/debian/patches/0018-lisp-support-in-src-Makefile.patch b/debian/patches/0018-lisp-support-in-src-Makefile.patch
index 10405cd..a6a3667 100644
--- a/debian/patches/0018-lisp-support-in-src-Makefile.patch
+++ b/debian/patches/0018-lisp-support-in-src-Makefile.patch
@@ -9,21 +9,19 @@ belonging to the lisp part.
sys/unix/Makefile.src | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
-diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src
-index 29ad99a..0b75660 100644
--- a/sys/unix/Makefile.src
+++ b/sys/unix/Makefile.src
-@@ -216,6 +216,9 @@ WINBEOBJ =
+@@ -224,6 +224,9 @@ WINBEOBJ =
#
- WINSRC = $(WINTTYSRC)
- WINOBJ = $(WINTTYOBJ)
+ #WINSRC = $(WINTTYSRC)
+ #WINOBJ = $(WINTTYOBJ)
+# Files for the lisp port
+WINLISPSRC = ../win/lisp/winlisp.c tile.c
+WINLISPOBJ = winlisp.o tile.o
# on some systems the termcap library is in -ltermcap or -lcurses
# on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
-@@ -338,7 +341,7 @@ SYSCSRC = ../sys/atari/tos.c ../sys/share/pcmain.c ../sys/share/pcsys.c \
+@@ -352,7 +355,7 @@ SYSCSRC = ../sys/atari/tos.c ../sys/shar
GENCSRC = monstr.c vis_tab.c #tile.c
# all windowing-system-dependent .c (for dependencies and such)
@@ -32,7 +30,7 @@ index 29ad99a..0b75660 100644
# all windowing-system-dependent .cpp (for dependencies and such)
WINCXXSRC = $(WINQTSRC) $(WINBESRC)
-@@ -683,6 +686,9 @@ load_img.o: ../win/gem/load_img.c ../include/load_img.h
+@@ -709,6 +712,9 @@ load_img.o: ../win/gem/load_img.c ../inc
$(CC) $(CFLAGS) -c ../win/gem/load_img.c
gr_rect.o: ../win/gem/gr_rect.c ../include/gr_rect.h
$(CC) $(CFLAGS) -c ../win/gem/gr_rect.c
@@ -42,13 +40,13 @@ index 29ad99a..0b75660 100644
tile.o: tile.c $(HACK_H)
qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) ../include/func_tab.h \
../include/dlb.h ../include/patchlevel.h ../include/tile2x11.h \
-@@ -803,7 +809,8 @@ vision.o: vision.c $(HACK_H) ../include/vis_tab.h
+@@ -834,7 +840,8 @@ vision.o: vision.c $(HACK_H) ../include/
weapon.o: weapon.c $(HACK_H)
were.o: were.c $(HACK_H)
wield.o: wield.c $(HACK_H)
-windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h
+windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h \
+ ../include/winlisp.h
- wizard.o: wizard.c $(HACK_H) ../include/qtext.h ../include/epri.h
+ wizard.o: wizard.c $(HACK_H) ../include/qtext.h
worm.o: worm.c $(HACK_H) ../include/lev.h
worn.o: worn.c $(HACK_H)
diff --git a/debian/patches/0019-stay-in-array-bounds.patch b/debian/patches/0019-stay-in-array-bounds.patch
index df46b38..6cbd6e9 100644
--- a/debian/patches/0019-stay-in-array-bounds.patch
+++ b/debian/patches/0019-stay-in-array-bounds.patch
@@ -10,16 +10,14 @@ misoptimisations by the compiler.
src/mhitu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/src/mhitu.c b/src/mhitu.c
-index 7df5b5e..6b10f33 100644
--- a/src/mhitu.c
+++ b/src/mhitu.c
-@@ -233,7 +233,7 @@ boolean message;
- for(i = 0; i < NATTK; i++)
- if(mdat->mattk[i].aatyp == AT_ENGL)
- break;
-- if (mdat->mattk[i].aatyp != AT_ENGL)
-+ if (i >= NATTK || mdat->mattk[i].aatyp != AT_ENGL)
- impossible("Swallower has no engulfing attack?");
- else {
- if (is_whirly(mdat)) {
+@@ -227,7 +227,7 @@ boolean message;
+ for (i = 0; i < NATTK; i++)
+ if (mdat->mattk[i].aatyp == AT_ENGL)
+ break;
+- if (mdat->mattk[i].aatyp != AT_ENGL)
++ if (i >= NATTK || mdat->mattk[i].aatyp != AT_ENGL)
+ impossible("Swallower has no engulfing attack?");
+ else {
+ if (is_whirly(mdat)) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/nethack.git
More information about the Pkg-games-commits
mailing list