diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-09-10 20:04:10 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-09-10 20:04:10 (GMT) |
commit | 1a42af4f8eef021dc46fec2949865376819d9795 (patch) | |
tree | e366f4f5a8af7e0641061ad1c3f033cb69bb5357 | |
parent | 870e3b5d95325fb625374c0b97314635a784e806 (diff) | |
download | tcl-1a42af4f8eef021dc46fec2949865376819d9795.zip tcl-1a42af4f8eef021dc46fec2949865376819d9795.tar.gz tcl-1a42af4f8eef021dc46fec2949865376819d9795.tar.bz2 |
Fix [Bug 1025359]; make sure wide seeks don't lose errors
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclIO.c | 10 |
2 files changed, 10 insertions, 5 deletions
@@ -1,3 +1,8 @@ +2004-09-10 Donal K. Fellows <donal.k.fellows@man.ac.uk> + + * generic/tclIO.c (Tcl_Seek): Make sure wide seeks do not fail to + set ::errorCode on error. [Bug 1025359] + 2004-09-10 Andreas Kupries <andreask@activestate.com> * generic/tcl.h: Micro formatting fixes. diff --git a/generic/tclIO.c b/generic/tclIO.c index 295225c..13630ac 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.c,v 1.77 2004/07/15 20:46:49 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.78 2004/09/10 20:04:10 dkf Exp $ */ #include "tclInt.h" @@ -5565,15 +5565,15 @@ Tcl_Seek(chan, offset, mode) offset, mode, &result); } else if (offset < Tcl_LongAsWide(LONG_MIN) || offset > Tcl_LongAsWide(LONG_MAX)) { - Tcl_SetErrno(EOVERFLOW); + result = EOVERFLOW; curPos = Tcl_LongAsWide(-1); } else { curPos = Tcl_LongAsWide((chanPtr->typePtr->seekProc) ( chanPtr->instanceData, Tcl_WideAsLong(offset), mode, &result)); - if (curPos == Tcl_LongAsWide(-1)) { - Tcl_SetErrno(result); - } + } + if (curPos == Tcl_LongAsWide(-1)) { + Tcl_SetErrno(result); } } |