summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-01-23 21:21:26 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-01-23 21:21:26 (GMT)
commit0631e4f3f4260d3fbc773676389783ec4d31c480 (patch)
treea1b52e7723f15d31eb1d37d49c9cc69b7d9cf7cd /generic/tclIOUtil.c
parentf7f6ddb4ce3ce465107777a9a2c408dd8ab473dc (diff)
downloadtcl-0631e4f3f4260d3fbc773676389783ec4d31c480.zip
tcl-0631e4f3f4260d3fbc773676389783ec4d31c480.tar.gz
tcl-0631e4f3f4260d3fbc773676389783ec4d31c480.tar.bz2
Reconcile coding style issues between branches
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 50645fa..c996b1f 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.149 2007/12/14 23:36:09 hobbs Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.150 2008/01/23 21:21:31 dgp Exp $
*/
#include "tclInt.h"
@@ -1755,7 +1755,7 @@ Tcl_FSEvalFileEx(
const char *encodingName) /* If non-NULL, then use this encoding for the
* file. NULL means use the system encoding. */
{
- int result, length;
+ int length, result = TCL_ERROR;
Tcl_StatBuf statBuf;
Tcl_Obj *oldScriptFile;
Interp *iPtr;
@@ -1764,25 +1764,21 @@ Tcl_FSEvalFileEx(
Tcl_Obj *objPtr;
if (Tcl_FSGetNormalizedPath(interp, pathPtr) == NULL) {
- return TCL_ERROR;
+ return result;
}
- result = TCL_ERROR;
- objPtr = Tcl_NewObj();
- Tcl_IncrRefCount(objPtr);
-
if (Tcl_FSStat(pathPtr, &statBuf) == -1) {
Tcl_SetErrno(errno);
Tcl_AppendResult(interp, "couldn't read file \"",
Tcl_GetString(pathPtr), "\": ", Tcl_PosixError(interp), NULL);
- goto end;
+ return result;
}
chan = Tcl_FSOpenFileChannel(interp, pathPtr, "r", 0644);
if (chan == (Tcl_Channel) NULL) {
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "couldn't read file \"",
Tcl_GetString(pathPtr), "\": ", Tcl_PosixError(interp), NULL);
- goto end;
+ return result;
}
/*
@@ -1801,10 +1797,12 @@ Tcl_FSEvalFileEx(
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
!= TCL_OK) {
Tcl_Close(interp,chan);
- goto end;
+ return result;
}
}
+ objPtr = Tcl_NewObj();
+ Tcl_IncrRefCount(objPtr);
if (Tcl_ReadChars(chan, objPtr, -1, 0) < 0) {
Tcl_Close(interp, chan);
Tcl_AppendResult(interp, "couldn't read file \"",