summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
authorvasiljevic <zv@archiware.com>2005-04-16 08:04:56 (GMT)
committervasiljevic <zv@archiware.com>2005-04-16 08:04:56 (GMT)
commitf2ce090ed548161bc4bc0ce8ee42d01a7782bca9 (patch)
tree255715b187b47cb678a9b4fc77af491d52a6b46d /generic/tclIOUtil.c
parent5956da89a3a4eac4457450902875543f73c4defa (diff)
downloadtcl-f2ce090ed548161bc4bc0ce8ee42d01a7782bca9.zip
tcl-f2ce090ed548161bc4bc0ce8ee42d01a7782bca9.tar.gz
tcl-f2ce090ed548161bc4bc0ce8ee42d01a7782bca9.tar.bz2
Force clenaup of the interp result in TclLoadFile(). Some implementations
of TclpFindSymbol() will seed the interp result with error message when unable to find the requested symbol (this is not considered to be error).
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 148f99f..6fc27f0 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.115 2005/01/14 16:41:31 dkf Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.116 2005/04/16 08:04:56 vasiljevic Exp $
*/
#include "tclInt.h"
@@ -2986,7 +2986,8 @@ TclLoadFile(interp, pathPtr, symc, symbols, procPtrs,
}
/* Copy this across, since both are equal for the native fs */
*clientDataPtr = (ClientData)*handlePtr;
- return retVal;
+ Tcl_ResetResult(interp);
+ return TCL_OK;
}
if (Tcl_GetErrno() != EXDEV) {
return retVal;
@@ -3011,7 +3012,9 @@ TclLoadFile(interp, pathPtr, symc, symbols, procPtrs,
*/
copyToPtr = TclpTempFileName();
if (copyToPtr == NULL) {
- return -1;
+ Tcl_AppendResult(interp, "couldn't create temporary file: ",
+ Tcl_PosixError(interp), (char *) NULL);
+ return TCL_ERROR;
}
Tcl_IncrRefCount(copyToPtr);
@@ -3025,7 +3028,9 @@ TclLoadFile(interp, pathPtr, symc, symbols, procPtrs,
*/
Tcl_FSDeleteFile(copyToPtr);
Tcl_DecrRefCount(copyToPtr);
- return -1;
+ Tcl_AppendResult(interp, "couldn't load from current filesystem",
+ (char *) NULL);
+ return TCL_ERROR;
}
if (TclCrossFilesystemCopy(interp, pathPtr, copyToPtr) == TCL_OK) {
@@ -3090,6 +3095,7 @@ TclLoadFile(interp, pathPtr, symc, symbols, procPtrs,
(*handlePtr) = newLoadHandle;
(*clientDataPtr) = newClientData;
(*unloadProcPtr) = newUnloadProcPtr;
+ Tcl_ResetResult(interp);
return TCL_OK;
}
/*
@@ -3138,6 +3144,7 @@ TclLoadFile(interp, pathPtr, symc, symbols, procPtrs,
(*handlePtr) = newLoadHandle;
(*clientDataPtr) = (ClientData)tvdlPtr;
(*unloadProcPtr) = &FSUnloadTempFile;
+ Tcl_ResetResult(interp);
return retVal;
} else {
/* Cross-platform copy failed */
@@ -3147,7 +3154,7 @@ TclLoadFile(interp, pathPtr, symc, symbols, procPtrs,
}
}
Tcl_SetErrno(ENOENT);
- return -1;
+ return TCL_ERROR;
}
/*
* This function used to be in the platform specific directories, but it