Thanks to Doug Mencken I found out that statmsg can be optimized out and my bypass of TT_ERR_PTYPE doesn't work on some platforms. This patch checks the value of status directly like I should have in the first place and doesn't have that problem.

>From c05c883cdb4a8e7cf2362a1c1fd67db6d0df93e0 Mon Sep 17 00:00:00 2001
From: William Schaub <wsch...@genesi-tech.com>
Date: Sun, 12 Aug 2012 16:24:36 -0400
Subject: [PATCH] dtcreate: check for TT_ERR_PTYPE the correct way

---
 cde/programs/dtcreate/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cde/programs/dtcreate/main.c b/cde/programs/dtcreate/main.c
index 1b56e3f..6fd972c 100644
--- a/cde/programs/dtcreate/main.c
+++ b/cde/programs/dtcreate/main.c
@@ -549,7 +549,7 @@ DieFromToolTalkError(Widget parent, char *errfmt, Tt_status status)
 
     statmsg = tt_status_message(status);
     /* Solaris dtcreate ignores this so we should too */
-    if(!strncmp("TT_ERR_PTYPE",statmsg,12))
+    if(status == TT_ERR_PTYPE)
             return;
     errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2);
     sprintf(errmsg, errfmt, statmsg);
-- 
1.7.2.5

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to