diff options
author | dgp <dgp@users.sourceforge.net> | 2008-05-21 20:38:06 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2008-05-21 20:38:06 (GMT) |
commit | e6f74fe56314ceb887b5ba5cb31e0fbbd47dc39f (patch) | |
tree | e73485452a99136fe69e0b9ef17b3662d2afe29f /generic/tclParse.c | |
parent | 101190f926650dbdad3433ea81658e693eea44b3 (diff) | |
download | tcl-e6f74fe56314ceb887b5ba5cb31e0fbbd47dc39f.zip tcl-e6f74fe56314ceb887b5ba5cb31e0fbbd47dc39f.tar.gz tcl-e6f74fe56314ceb887b5ba5cb31e0fbbd47dc39f.tar.bz2 |
* generic/tclParse.c (ParseComment): The new TclParseAllWhiteSpace()
* tests/parse.test (parse-15.60): routine has no mechanism to
return the "incomplete" status of "\\\n" so calling this routine
anywhere that can be reached within a Tcl_ParseCommand() call is a
mistake. In particular, ParseComment() must not use it. [Bug 1968882].
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r-- | generic/tclParse.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c index b639f09..3197ac8 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclParse.c,v 1.62 2008/01/23 21:58:36 dgp Exp $ + * RCS: @(#) $Id: tclParse.c,v 1.62.2.1 2008/05/21 20:38:09 dgp Exp $ */ #include "tclInt.h" @@ -954,9 +954,12 @@ ParseComment( char type; int scanned; - scanned = TclParseAllWhiteSpace(p, numBytes); - p += scanned; - numBytes -= scanned; + do { + scanned = ParseWhiteSpace(p, numBytes, + &parsePtr->incomplete, &type); + p += scanned; + numBytes -= scanned; + } while (numBytes && (*p == '\n') && (p++,numBytes--)); if ((numBytes == 0) || (*p != '#')) { break; @@ -1871,7 +1874,7 @@ Tcl_SubstObj( int length, tokensLeft, code; Tcl_Token *endTokenPtr; Tcl_Obj *result, *errMsg = NULL; - CONST char *p = TclGetStringFromObj(objPtr, &length); + const char *p = TclGetStringFromObj(objPtr, &length); Tcl_Parse *parsePtr = (Tcl_Parse *) TclStackAlloc(interp, sizeof(Tcl_Parse)); |