diff options
author | hobbs <hobbs@noemail.net> | 2007-12-14 02:29:20 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2007-12-14 02:29:20 (GMT) |
commit | c60bb808b460ab43a77db508493847e1ed6b09d6 (patch) | |
tree | 32d0f03e9786e52c0c9bf57cd38840852676224c /generic/tclIOUtil.c | |
parent | a3a1d914397ffbd2ba1c9893b14ae1ee87f77495 (diff) | |
download | tcl-c60bb808b460ab43a77db508493847e1ed6b09d6.zip tcl-c60bb808b460ab43a77db508493847e1ed6b09d6.tar.gz tcl-c60bb808b460ab43a77db508493847e1ed6b09d6.tar.bz2 |
* generic/tclIOUtil.c (TclGetOpenMode): Only set the O_APPEND flag
* tests/ioUtil.test (ioUtil-4.1): on a channel for the 'a'
mode and not for 'a+'. [Bug 1773127] (backport from HEAD)
FossilOrigin-Name: cbd24bea388c5c52d0b46fcbb9462f47c180a249
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r-- | generic/tclIOUtil.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index a587794..aae1e84 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.77.2.34 2007/02/19 23:49:05 hobbs Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.35 2007/12/14 02:29:21 hobbs Exp $ */ #include "tclInt.h" @@ -1585,7 +1585,11 @@ TclGetOpenMode(interp, string, seekFlagPtr) return -1; } if (string[1] == '+') { - mode &= ~(O_RDONLY|O_WRONLY); + /* + * Must remove the O_APPEND flag so that the seek command + * works. [Bug 1773127] + */ + mode &= ~(O_RDONLY|O_WRONLY|O_APPEND); mode |= O_RDWR; if (string[2] != 0) { goto error; |