summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
diff options
context:
space:
mode:
authorstanton <stanton>1998-12-02 21:45:42 (GMT)
committerstanton <stanton>1998-12-02 21:45:42 (GMT)
commit30395d1e2d42a80bf30f0a6f126b8e6cd44ef53f (patch)
tree4f2f5869d4f5d7ec290eb97ecd30701f37c4539d /generic/tclParse.c
parent0ba05b173fe17b05c81447c90e27573f0adcdffa (diff)
downloadtcl-30395d1e2d42a80bf30f0a6f126b8e6cd44ef53f.zip
tcl-30395d1e2d42a80bf30f0a6f126b8e6cd44ef53f.tar.gz
tcl-30395d1e2d42a80bf30f0a6f126b8e6cd44ef53f.tar.bz2
* generic/tclParse.c (Tcl_ParseCommand): Fixed bug in comment
parsing where a trailing comment looked like an incomplete command.
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r--generic/tclParse.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index 1c162b3..60ef783 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -9,11 +9,12 @@
* allow scripts to be evaluated directly, without compiling.
*
* Copyright (c) 1997 Sun Microsystems, Inc.
+ * Copyright (c) 1998 by Scriptics Corporation.
*
* 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.1.2.6 1998/12/02 01:59:35 stanton Exp $
+ * RCS: @(#) $Id: tclParse.c,v 1.1.2.7 1998/12/02 21:45:42 stanton Exp $
*/
#include "tclInt.h"
@@ -308,7 +309,9 @@ Tcl_ParseCommand(interp, string, numBytes, nested, parsePtr)
}
while (1) {
if (src == parsePtr->end) {
- parsePtr->incomplete = 1;
+ if (nested) {
+ parsePtr->incomplete = nested;
+ }
parsePtr->commentSize = src - parsePtr->commentStart;
break;
} else if (*src == '\\') {
@@ -885,7 +888,7 @@ EvalObjv(interp, objc, objv, command, length, flags)
if (length < 0) {
length = strlen(command);
- } else if (length < strlen(command)) {
+ } else if ((size_t)length < strlen(command)) {
commandCopy = (char *) ckalloc((unsigned) (length + 1));
strncpy(commandCopy, command, (size_t) length);
commandCopy[length] = 0;