Module Name:    src
Committed By:   christos
Date:           Fri Jun 12 15:19:52 UTC 2009

Modified Files:
        src/usr.bin/window: ttgeneric.c

Log Message:
PR/41581: Der mouse: window SEGV with certain terminals. does strcmp first
and then checks for null pointer for underline and bold.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/window/ttgeneric.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/window/ttgeneric.c
diff -u src/usr.bin/window/ttgeneric.c:1.10 src/usr.bin/window/ttgeneric.c:1.11
--- src/usr.bin/window/ttgeneric.c:1.10	Tue Apr 14 04:50:06 2009
+++ src/usr.bin/window/ttgeneric.c	Fri Jun 12 11:19:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttgeneric.c,v 1.10 2009/04/14 08:50:06 lukem Exp $	*/
+/*	$NetBSD: ttgeneric.c,v 1.11 2009/06/12 15:19:52 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)ttgeneric.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: ttgeneric.c,v 1.10 2009/04/14 08:50:06 lukem Exp $");
+__RCSID("$NetBSD: ttgeneric.c,v 1.11 2009/06/12 15:19:52 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -169,8 +169,8 @@
 		} else
 			if (gen_SE) {
 				ttxputs(gen_SE);
-				if (!strcmp(gen_SE->ts_str, gen_UE->ts_str) &&
-				    gen_UE && gen_US && new & WWM_UL)
+				if (gen_UE && gen_US && new & WWM_UL &&
+				    !strcmp(gen_SE->ts_str, gen_UE->ts_str))
 					ttxputs(gen_US);
 			}
 	}
@@ -181,8 +181,8 @@
 		} else
 			if (gen_UE) {
 				ttxputs(gen_UE);
-				if (!strcmp(gen_UE->ts_str, gen_SE->ts_str) &&
-				    gen_SE && gen_SO && new & WWM_REV)
+				if (gen_SE && gen_SO && new & WWM_REV &&
+				    !strcmp(gen_UE->ts_str, gen_SE->ts_str))
 					ttxputs(gen_SO);
 			}
 	}

Reply via email to