[Pkg-nethack-devel] nethack/debian/patches 18_windowtype_argv.dpatch,1.1,1.2

Joshua Kwan joshk-guest@quantz.debian.org
Wed, 03 Dec 2003 04:44:33 +0000


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

Modified Files:
	18_windowtype_argv.dpatch 
Log Message:
Fix a segfault caused by calling init_linux_cons before init_nhwindows.


Index: 18_windowtype_argv.dpatch
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/debian/patches/18_windowtype_argv.dpatch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- 18_windowtype_argv.dpatch	17 Nov 2003 02:59:19 -0000	1.1
+++ 18_windowtype_argv.dpatch	3 Dec 2003 04:44:30 -0000	1.2
@@ -18,9 +18,8 @@
 
 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
+--- nethack/sys/unix/unixmain.c~	2003-12-02 17:03:14.000000000 -0800
++++ nethack/sys/unix/unixmain.c	2003-12-02 20:36:57.000000000 -0800
 @@ -43,6 +43,7 @@
  #ifdef WIZARD
  static boolean wiz_error_flag = FALSE;
@@ -29,23 +28,40 @@
  
  int
  main(argc,argv)
-@@ -150,7 +151,6 @@
+@@ -88,8 +89,6 @@
+ 	hackpid = getpid();
+ 	(void) umask(0777 & ~FCMASK);
+ 
+-	choose_windows(DEFAULT_WINDOW_SYS);
+-
+ #ifdef CHDIR			/* otherwise no chdir() */
+ 	/*
+ 	 * See if we must change directory to the playground.
+@@ -150,7 +149,13 @@
  	check_linux_console();
  #endif
  	initoptions();
 -	init_nhwindows(&argc,argv);
++
++        process_options(argc, argv);	/* command line options */
++	if (!already_init_nhwindows) {
++	  choose_windows(DEFAULT_WINDOW_SYS);
++          init_nhwindows(&argc,argv);
++        }
++
  	exact_username = whoami();
  #ifdef _M_UNIX
  	init_sco_cons();
-@@ -169,6 +169,7 @@
+@@ -168,8 +173,6 @@
+ 	(void) signal(SIGXCPU, (SIG_RET_TYPE) hangup);
  #endif
  
- 	process_options(argc, argv);	/* command line options */
-+	if (!already_init_nhwindows) init_nhwindows(&argc,argv);
- 
+-	process_options(argc, argv);	/* command line options */
+-
  #ifdef DEF_PAGER
  	if(!(catmore = nh_getenv("HACKPAGER")) && !(catmore = nh_getenv("PAGER")))
-@@ -295,7 +296,7 @@
+ 		catmore = DEF_PAGER;
+@@ -295,7 +298,7 @@
  char *argv[];
  {
  	int i;
@@ -54,7 +70,7 @@
  
  	/*
  	 * Process options.
-@@ -385,6 +386,14 @@
+@@ -385,6 +388,14 @@
  			    	flags.initrace = i;
  			}
  			break;