[Pkg-nethack-devel] nethack/debian/patches 18_overridewin.dpatch,NONE,1.1 00list,1.13,1.14

Joshua Kwan joshk-guest@quantz.debian.org
Fri, 12 Dec 2003 03:59:57 +0000


Update of /cvsroot/pkg-nethack/nethack/debian/patches
In directory quantz:/tmp/cvs-serv2754/patches

Modified Files:
	00list 
Added Files:
	18_overridewin.dpatch 
Log Message:
This patch is the second iteration of 18_windowtype_argv.dpatch, using
an environment variable $OVERRIDEWIN this time. Works better. 'nuff said


Index: 00list
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/debian/patches/00list,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- 00list	9 Dec 2003 16:52:02 -0000	1.13
+++ 00list	12 Dec 2003 03:59:55 -0000	1.14
@@ -11,6 +11,7 @@
 15_recover_errormsg
 16_pixmapdir
 17_gnome_remove_drop_many
+18_overridewin
 90_enh_hpmon
 91_enh_menucolors
 92_enh_paranoid_hit

--- NEW FILE: 18_overridewin.dpatch ---
#! /bin/sh -e
## 18_overridewin.dpatch by Joshua Kwan <joshk@triplehelix.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Better way to do it.

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -f --no-backup-if-mismatch -p0 < $0;;
    -unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1;;
esac

exit 0

Index: src/windows.c
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/src/windows.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 windows.c
--- src/windows.c	7 Oct 2003 19:00:21 -0000	1.1.1.1
+++ src/windows.c	9 Dec 2003 18:20:08 -0000
@@ -96,10 +103,16 @@
 choose_windows(s)
 const char *s;
 {
+    char *ow, *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 (!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;