summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-07-06 21:08:36 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-07-06 21:08:36 (GMT)
commit20d4b34f6477d15f854d40540e12bb756e48d90e (patch)
tree51a329e37b8b741eac047447f44baaf03c6e9475 /generic/tclCompile.c
parentb7a17dd6698402d0a310eea11b8969e79d2f3680 (diff)
downloadtcl-20d4b34f6477d15f854d40540e12bb756e48d90e.zip
tcl-20d4b34f6477d15f854d40540e12bb756e48d90e.tar.gz
tcl-20d4b34f6477d15f854d40540e12bb756e48d90e.tar.bz2
* tests/cmdMZ.test (cmdMZ-return-2.17): Added a test that a word
containing backslash-quoted value is treated correctly. * generic/tclCompile.c (TclWordKnownAtCompileTime): [Bug 986196] Corrected flaw above and the flaw that caused TCL_TOKEN_SIMPLE_WORDs to have their original word value copied ( "{a b}" ) rather than the actual value ( "a b" ). Thanks to Kevin Kenny for report and tests.
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r--generic/tclCompile.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 58627d1..92d3368 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompile.c,v 1.67 2004/06/08 19:27:01 msofer Exp $
+ * RCS: @(#) $Id: tclCompile.c,v 1.68 2004/07/06 21:08:36 dgp Exp $
*/
#include "tclInt.h"
@@ -832,7 +832,7 @@ TclWordKnownAtCompileTime(tokenPtr, valuePtr)
if (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
if (valuePtr != NULL) {
- Tcl_AppendToObj(valuePtr, tokenPtr->start, tokenPtr->size);
+ Tcl_AppendToObj(valuePtr, tokenPtr[1].start, tokenPtr[1].size);
}
return 1;
}
@@ -850,7 +850,7 @@ TclWordKnownAtCompileTime(tokenPtr, valuePtr)
if (tempPtr != NULL) {
Tcl_AppendToObj(tempPtr, tokenPtr->start, tokenPtr->size);
}
- continue;
+ break;
case TCL_TOKEN_BS:
if (tempPtr != NULL) {
@@ -859,7 +859,7 @@ TclWordKnownAtCompileTime(tokenPtr, valuePtr)
Tcl_UtfBackslash(tokenPtr->start, NULL, utfBuf);
Tcl_AppendToObj(tempPtr, utfBuf, length);
}
- continue;
+ break;
default:
if (tempPtr != NULL) {
@@ -867,6 +867,7 @@ TclWordKnownAtCompileTime(tokenPtr, valuePtr)
}
return 0;
}
+ tokenPtr++;
}
if (valuePtr != NULL) {
Tcl_AppendObjToObj(valuePtr, tempPtr);