summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompCmds.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 60f209f..f16d579 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.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: tclCompCmds.c,v 1.125 2007/11/14 00:50:50 hobbs Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.126 2007/11/14 00:56:44 hobbs Exp $
*/
#include "tclInt.h"
@@ -4090,7 +4090,6 @@ TclCompileSwitchCmd(
if (bodyToken[i]->type == TCL_TOKEN_TEXT) {
Tcl_DString ds;
- simple = 1;
if (bodyToken[i]->size == 0) {
/*
* The semantics of regexps are that they always match
@@ -4106,17 +4105,15 @@ TclCompileSwitchCmd(
* the converted pattern.
*/
- Tcl_DStringInit(&ds);
if (TclReToGlob(NULL, bodyToken[i]->start,
- bodyToken[i]->size, &ds, &exact) != TCL_OK) {
- TclCompileTokens(interp, bodyToken[i], 1, envPtr);
- simple = 0;
- } else {
+ bodyToken[i]->size, &ds, &exact) == TCL_OK) {
+ simple = 1;
PushLiteral(envPtr, Tcl_DStringValue(&ds),
Tcl_DStringLength(&ds));
+ Tcl_DStringFree(&ds);
}
- Tcl_DStringFree(&ds);
- } else {
+ }
+ if (!simple) {
TclCompileTokens(interp, bodyToken[i], 1, envPtr);
}