summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2012-04-15 17:36:34 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2012-04-15 17:36:34 (GMT)
commitd5779eb0bd5570dd64404ab87ca8c664a1a8fa37 (patch)
treef058b77cfd6d4484f07e7334965d79ca3b339adc /generic/tclIOUtil.c
parent4602c263bc874dc6512705f9c2a1677e624064a2 (diff)
downloadtcl-d5779eb0bd5570dd64404ab87ca8c664a1a8fa37.zip
tcl-d5779eb0bd5570dd64404ab87ca8c664a1a8fa37.tar.gz
tcl-d5779eb0bd5570dd64404ab87ca8c664a1a8fa37.tar.bz2
minor comment formatting
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 3c98128..c4e7db0 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -1860,9 +1860,12 @@ TclNREvalFile(
objPtr = Tcl_NewObj();
Tcl_IncrRefCount(objPtr);
- /* Try to read first character of stream, so we can
- * check for utf-8 BOM to be handled especially.
+
+ /*
+ * Try to read first character of stream, so we can check for utf-8 BOM to
+ * be handled especially.
*/
+
if (Tcl_ReadChars(chan, objPtr, 1, 0) < 0) {
Tcl_Close(interp, chan);
Tcl_AppendResult(interp, "couldn't read file \"",
@@ -1871,15 +1874,17 @@ TclNREvalFile(
return TCL_ERROR;
}
string = Tcl_GetString(objPtr);
+
/*
* If first character is not a BOM, append the remaining characters,
- * otherwise replace them [Bug 3466099].
+ * otherwise replace them. [Bug 3466099]
*/
+
if (Tcl_ReadChars(chan, objPtr, -1,
memcmp(string, "\xef\xbb\xbf", 3)) < 0) {
Tcl_Close(interp, chan);
Tcl_AppendResult(interp, "couldn't read file \"",
- Tcl_GetString(pathPtr), "\": ", Tcl_PosixError(interp), NULL);
+ Tcl_GetString(pathPtr), "\": ", Tcl_PosixError(interp), NULL);
Tcl_DecrRefCount(objPtr);
return TCL_ERROR;
}