summaryrefslogtreecommitdiffstats
path: root/mac/tclMacOSA.c
diff options
context:
space:
mode:
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: \"",