summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2007-12-14 02:29:20 (GMT)
committerhobbs <hobbs>2007-12-14 02:29:20 (GMT)
commit1c95363481976a57b43d204d6f6d5e364bbb56b6 (patch)
tree32d0f03e9786e52c0c9bf57cd38840852676224c /generic
parent7579bff98894f7f03c12fae6ecbd01e473d06021 (diff)
downloadtcl-1c95363481976a57b43d204d6f6d5e364bbb56b6.zip
tcl-1c95363481976a57b43d204d6f6d5e364bbb56b6.tar.gz
tcl-1c95363481976a57b43d204d6f6d5e364bbb56b6.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)
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIOUtil.c8
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;