diff options
author | mdejong <mdejong> | 2003-03-06 09:58:44 (GMT) |
---|---|---|
committer | mdejong <mdejong> | 2003-03-06 09:58:44 (GMT) |
commit | c2ce0bdf9e6f8693a01148c0a34d49020712fd65 (patch) | |
tree | c02a2ec95dadec6446f2a1063640f76a0cff33dd | |
parent | 07b4cc33fb2184b87a048a0a930f1396a70d9df5 (diff) | |
download | tcl-c2ce0bdf9e6f8693a01148c0a34d49020712fd65.zip tcl-c2ce0bdf9e6f8693a01148c0a34d49020712fd65.tar.gz tcl-c2ce0bdf9e6f8693a01148c0a34d49020712fd65.tar.bz2 |
* generic/tclIO.c (Tcl_GetsObj): Check that
the eol pointer has not gone past the end
of the string when in auto translation
mode and the INPUT_SAW_CR flag is set.
The previous code worked because the
end of string value \0 was being compared
to \n, this patch just skips that pointless
check.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | generic/tclIO.c | 4 |
2 files changed, 13 insertions, 2 deletions
@@ -1,5 +1,16 @@ 2003-03-06 Mo DeJong <mdejong@users.sourceforge.net> + * generic/tclIO.c (Tcl_GetsObj): Check that + the eol pointer has not gone past the end + of the string when in auto translation + mode and the INPUT_SAW_CR flag is set. + The previous code worked because the + end of string value \0 was being compared + to \n, this patch just skips that pointless + check. + +2003-03-06 Mo DeJong <mdejong@users.sourceforge.net> + * generic/tclIO.c (WriteBytes, WriteChars, Tcl_GetsObj, ReadBytes): Rework calls to TranslateOutputEOL to make it clear that diff --git a/generic/tclIO.c b/generic/tclIO.c index f972480..4ffcfb2 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.63 2003/03/06 09:47:49 mdejong Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.64 2003/03/06 09:58:44 mdejong Exp $ */ #include "tclInt.h" @@ -3642,7 +3642,7 @@ Tcl_GetsObj(chan, objPtr) skip = 1; if (statePtr->flags & INPUT_SAW_CR) { statePtr->flags &= ~INPUT_SAW_CR; - if (*eol == '\n') { + if ((eol < dstEnd) && (*eol == '\n')) { /* * Skip the raw bytes that make up the '\n'. */ |