From: Daniel A. S. <st...@ic...> - 2003-05-22 00:59:38
|
Vince, On Thursday, May 22, 2003, at 07:56 Australia/Sydney, Vince Darley wrote: > I've just updated to latest cvs head of Tcl and Tk, and I've noticed > two > changes: > > (i) Wish comes up without a console window (when double clicked in the > finder) > > (ii) When Wish is started from the command-line, still no console > window, > but since I have a '%' prompt I can investigate, and Wish only has the > built in encodings (3 of them), not the usual list of 30+ > > tclsh8.5 on the other hand works just fine and has all the encodings. oy, this is very bad; it looks like this is due to a bug in my new Tcl_MacOSXOpenVersionedBundleResources(), caused by unexpected behaviour from CFBundleGetBundleWithIdentifier(). It seems that this API doesn't always return the bundle of given id corresponding to the framework it was linked with (despite what the docs suggest) but the last bundle created with the given id. In the current implementation this causes only the first call to Tcl_MacOSXOpenVersionedBundleResources to succeed for a given bundle id, any subsequent calls will return that the bundle resources have not been found, because we then look for them in e.g. Tcl.framework/Versions/8.4/Versions/8.4 :-( Because Tcl_MacOSXOpenVersionedBundleResources is called whenever an interp is created, only the first interp will have access to the tcl/tk library (e.g. encodings, console.tcl) etc. it's strange that this problem didn't show up in the tcl testsuite, it creates more than one interp on many occasions AFAIK. The patch below fixes the problem, I'll check it in to the HEAD asap. The big problem is that this bug made it into 8.4.3 :-( Jeff, as this breaks Tk massively, is there any way that we can check the patch belwo into core-8-4-branch and retag? only macosx is affected... very sorry about the mess ! Cheers, Daniel -- ** Daniel A. Steffen ** "And now for something completely ** Dept. of Mathematics ** different" Monty Python ** Macquarie University ** <mailto:st...@ma...> ** NSW 2109 Australia ** <http://www.maths.mq.edu.au/~steffen/> ------------------------------------------------------------------------ -------- Index: macosx/tclMacOSXBundle.c =================================================================== RCS file: /cvsroot/tcl/tcl/macosx/tclMacOSXBundle.c,v retrieving revision 1.3.2.1 diff -u -r1.3.2.1 tclMacOSXBundle.c --- macosx/tclMacOSXBundle.c 13 May 2003 08:41:26 -0000 1.3.2.1 +++ macosx/tclMacOSXBundle.c 22 May 2003 00:48:39 -0000 @@ -138,6 +138,16 @@ bundleVersion, kCFStringEncodingUTF8); CFURLRef bundleURL = CFBundleCopyBundleURL(bundleRef); if (bundleURL) { + CFStringRef bundleTailRef = CFURLCopyLastPathComponent(bundleURL); + if (bundleTailRef) { + if (CFStringCompare(bundleTailRef,bundleVersionRef,0) + == kCFCompareEqualTo) { + versionedBundleRef = bundleRef; + } + CFRelease(bundleTailRef); + } + } + if (bundleURL && !versionedBundleRef) { CFURLRef versURL = CFURLCreateCopyAppendingPathComponent(NULL, bundleURL, CFSTR("Versions"), TRUE); if (versURL) { |