summaryrefslogtreecommitdiffstats
path: root/mac/tclMacOSA.c
diff options
context:
space:
mode:
authordas <das>2002-04-08 09:02:00 (GMT)
committerdas <das>2002-04-08 09:02:00 (GMT)
commit0a15882ec2062a8b32ec855925a73e5644108f40 (patch)
tree862099671ae61cb7366e579a4a370691d8ae40fc /mac/tclMacOSA.c
parent99e8896f2e7f6cdf266ea20b486a1587ba574dba (diff)
downloadtcl-0a15882ec2062a8b32ec855925a73e5644108f40.zip
tcl-0a15882ec2062a8b32ec855925a73e5644108f40.tar.gz
tcl-0a15882ec2062a8b32ec855925a73e5644108f40.tar.bz2
2002-04-08 Daniel Steffen <das@users.sourceforge.net>
* generic/tcl.h: no <sys/types.h> on mac. * mac/tclMacFile.c: minor fixes to Vince's changes from 03-24. * mac/tclMacOSA.c: * mac/tclMacResource.c: added missing Tcl_UtfToExternalDString conversions of resource file names. * mac/tclMacSock.c (TcpGetOptionProc): fixed bug introduced by Andreas on 02-25; changed strcmp's to strncmp's so that option comparison behaves like on other platforms. * mac/tcltkMacBuildSupport.sea.hqx (CW Pro6 changes): added support to allow Tk to hookup C library stderr/stdout to TkConsole. * tests/basic.test: * tests/cmdAH.test: * tests/encoding.test: * tests/fileSystem.test: * tests/ioCmd.test: fixed tests failing on mac: check for existence of [exec], changed some result strings.
Diffstat (limited to 'mac/tclMacOSA.c')
-rw-r--r--mac/tclMacOSA.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/mac/tclMacOSA.c b/mac/tclMacOSA.c
index 8402df5..67275c6 100644
--- a/mac/tclMacOSA.c
+++ b/mac/tclMacOSA.c
@@ -12,7 +12,7 @@
* See the file "License Terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMacOSA.c,v 1.8 2002/01/25 20:40:56 dgp Exp $
+ * RCS: @(#) $Id: tclMacOSA.c,v 1.9 2002/04/08 09:02:48 das Exp $
*/
#define MAC_TCL
@@ -2067,7 +2067,7 @@ tclOSAStore(
short saveRef, fileRef = -1;
char idStr[16 + TCL_INTEGER_SPACE];
FSSpec fileSpec;
- Tcl_DString buffer;
+ Tcl_DString ds, buffer;
CONST char *nativeName;
OSErr myErr = noErr;
OSAID scriptID;
@@ -2105,13 +2105,14 @@ tclOSAStore(
if (fileName != NULL) {
OSErr err;
- Tcl_DStringInit(&buffer);
- nativeName = Tcl_TranslateFileName(interp, fileName, &buffer);
- if (nativeName == NULL) {
+ if (Tcl_TranslateFileName(interp, fileName, &buffer) == NULL) {
return TCL_ERROR;
}
+ nativeName = Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&buffer),
+ Tcl_DStringLength(&buffer), &ds);
err = FSpLocationFromPath(strlen(nativeName), nativeName, &fileSpec);
+ Tcl_DStringFree(&ds);
Tcl_DStringFree(&buffer);
if ((err != noErr) && (err != fnfErr)) {
Tcl_AppendResult(interp,
@@ -2286,7 +2287,7 @@ tclOSALoad(
short saveRef, fileRef = -1;
char idStr[16 + TCL_INTEGER_SPACE];
FSSpec fileSpec;
- Tcl_DString buffer;
+ Tcl_DString ds, buffer;
CONST char *nativeName;
saveRef = CurResFile();
@@ -2294,12 +2295,13 @@ tclOSALoad(
if (fileName != NULL) {
OSErr err;
- Tcl_DStringInit(&buffer);
- nativeName = Tcl_TranslateFileName(interp, fileName, &buffer);
- if (nativeName == NULL) {
+ if (Tcl_TranslateFileName(interp, fileName, &buffer) == NULL) {
return TCL_ERROR;
}
+ nativeName = Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&buffer),
+ Tcl_DStringLength(&buffer), &ds);
err = FSpLocationFromPath(strlen(nativeName), nativeName, &fileSpec);
+ Tcl_DStringFree(&ds);
Tcl_DStringFree(&buffer);
if (err != noErr) {
Tcl_AppendResult(interp, "Error finding the file: \"",