[Pkg-nethack-devel] nethack/debian/patches 18_windowtype_argv.dpatch,NONE,1.1 00list,1.10,1.11

Joshua Kwan joshk-guest@quantz.debian.org
Mon, 17 Nov 2003 02:59:21 +0000


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

Modified Files:
	00list 
Added Files:
	18_windowtype_argv.dpatch 
Log Message:
18_windowtype_argv.dpatch allows windowtype overriding. Let's make use of it!
Needs testing.


Index: 00list
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/debian/patches/00list,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- 00list	24 Oct 2003 18:44:09 -0000	1.10
+++ 00list	17 Nov 2003 02:59:19 -0000	1.11
@@ -14,6 +14,7 @@
 15_recover_errormsg
 16_pixmapdir
 17_gnome_remove_drop_many
+18_windowtype_argv
 90_enh_hpmon
 91_enh_menucolors
 92_enh_paranoid_hit

--- NEW FILE: 18_windowtype_argv.dpatch ---
#! /bin/sh -e
## 18_windowtype_argv.dpatch by Joshua Kwan <joshk@triplehelix.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Option -g sets the window type, overriding other options.

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 -p1 < $0;;
    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1;;
esac

exit 0


--- a/sys/unix/unixmain.c	7 Oct 2003 19:00:35 -0000	1.1.1.1
+++ b/sys/unix/unixmain.c	17 Nov 2003 02:49:45 -0000
@@ -43,6 +43,7 @@
 #ifdef WIZARD
 static boolean wiz_error_flag = FALSE;
 #endif
+static boolean already_init_nhwindows = FALSE;
 
 int
 main(argc,argv)
@@ -150,7 +151,6 @@
 	check_linux_console();
 #endif
 	initoptions();
-	init_nhwindows(&argc,argv);
 	exact_username = whoami();
 #ifdef _M_UNIX
 	init_sco_cons();
@@ -169,6 +169,7 @@
 #endif
 
 	process_options(argc, argv);	/* command line options */
+	if (!already_init_nhwindows) init_nhwindows(&argc,argv);
 
 #ifdef DEF_PAGER
 	if(!(catmore = nh_getenv("HACKPAGER")) && !(catmore = nh_getenv("PAGER")))
@@ -295,7 +296,7 @@
 char *argv[];
 {
 	int i;
-
+        char ** backupargv = argv;
 
 	/*
 	 * Process options.
@@ -385,6 +386,14 @@
 			    	flags.initrace = i;
 			}
 			break;
+                case 'g': /* windowtype */
+                        if (strlen(&argv[0][2]) <= 5) /* gnome == longest */
+                        {
+                          choose_windows(&argv[0][2]);
+                          init_nhwindows(&argc, backupargv);
+                          already_init_nhwindows = TRUE;
+                        }
+                        break;
 		case '@':
 			flags.randomall = 1;
 			break;