summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 24c9694..4591dbc 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.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: tclUtil.c,v 1.82.2.3 2007/11/12 19:18:20 dgp Exp $
+ * RCS: @(#) $Id: tclUtil.c,v 1.82.2.4 2007/11/13 13:07:42 dgp Exp $
*/
#include "tclInt.h"
@@ -2024,7 +2024,6 @@ Tcl_DStringResult(
} else {
Tcl_SetResult(interp, dsPtr->string, TCL_VOLATILE);
}
- ((Interp *) interp)->flags |= INTERP_RESULT_UNCLEAN;
dsPtr->string = dsPtr->staticSpace;
dsPtr->length = 0;
@@ -3194,6 +3193,8 @@ TclGetPlatform(void)
* Returns TCL_OK on success, TCL_ERROR on failure.
* If interp is not NULL, an error message is placed in the result.
* On success, the DString will contain an exact equivalent glob pattern.
+ * The caller is responsible for calling Tcl_DStringFree on success.
+ * If exactPtr is not NULL, it will be 1 if an exact match qualifies.
*
* Side effects:
* None.
@@ -3220,7 +3221,9 @@ TclReToGlob(Tcl_Interp *interp,
*/
if ((reStrLen >= 4) && (memcmp("***=", reStr, 4) == 0)) {
- *exactPtr = 1;
+ if (exactPtr) {
+ *exactPtr = 1;
+ }
Tcl_DStringAppend(dsPtr, reStr + 4, reStrLen - 4);
return TCL_OK;
}
@@ -3333,21 +3336,9 @@ TclReToGlob(Tcl_Interp *interp,
}
Tcl_DStringSetLength(dsPtr, dsStr - dsStrStart);
-#ifdef TCL_MEM_DEBUG
- /*
- * Check if this is a bad RE (do this at the end because it can be
- * expensive).
- * XXX: Is it possible that we can have a bad RE make it through the
- * XXX: above checks?
- */
-
- if (Tcl_RegExpCompile(NULL, reStr) == NULL) {
- msg = "couldn't compile RE";
- goto invalidGlob;
+ if (exactPtr) {
+ *exactPtr = (anchorLeft && anchorRight);
}
-#endif
-
- *exactPtr = (anchorLeft && anchorRight);
#if 0
fprintf(stderr, "INPUT RE '%.*s' OUTPUT GLOB '%s' anchor %d:%d \n",
@@ -3363,6 +3354,9 @@ TclReToGlob(Tcl_Interp *interp,
reStrLen, reStr, msg, *p);
fflush(stderr);
#endif
+ if (interp != NULL) {
+ Tcl_AppendResult(interp, msg, NULL);
+ }
Tcl_DStringFree(dsPtr);
return TCL_ERROR;
}