summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2008-07-26 11:17:23 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2008-07-26 11:17:23 (GMT)
commitc3574e6a659de1cae335c79d81865b60f67aea49 (patch)
tree5a7a6e841bda9c6edc8403701a5462ca2de81e67
parent70c62b8297815045091246addadfd5f57d3458ee (diff)
downloadtk-c3574e6a659de1cae335c79d81865b60f67aea49.zip
tk-c3574e6a659de1cae335c79d81865b60f67aea49.tar.gz
tk-c3574e6a659de1cae335c79d81865b60f67aea49.tar.bz2
bug #2026405: Check for 0x prefix in sprintf %p and redo if necessary. Works around cygwin issue.
-rw-r--r--ChangeLog4
-rw-r--r--win/tkWinWindow.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index afcbf80..20e58f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-07-26 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinWindow.c: Check for 0x prefix in sprintf %p. Bug [2026405]
+
2007-02-24 Jan Nijtmans <nijtmans@users.sf.net>
* generic/*.c: fix [2021443] inconsistant "wrong # args" messages
diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c
index 1c2745c..95e7a16 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinWindow.c,v 1.16 2008/04/27 22:39:17 dkf Exp $
+ * RCS: @(#) $Id: tkWinWindow.c,v 1.17 2008/07/26 11:17:25 patthoyts Exp $
*/
#include "tkWinInt.h"
@@ -174,9 +174,12 @@ TkpPrintWindowId(
/*
* Use pointer representation, because Win64 is P64 (*not* LP64). Windows
* doesn't print the 0x for %p, so we do it.
+ * bug #2026405: cygwin does output 0x for %p so test and recover.
*/
sprintf(buf, "0x%p", hwnd);
+ if (buf[2] == '0' && buf[3] == 'x')
+ sprintf(buf, "%p", hwnd);
}
/*