summaryrefslogtreecommitdiffstats
path: root/generic/tclTest.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-04-11 15:59:49 (GMT)
committervincentdarley <vincentdarley>2003-04-11 15:59:49 (GMT)
commita5499a51a90ae1c06f3f39ee05c4b42185e0f28c (patch)
tree324d5cddf5f2dfe379c3cf1427347351d8d683a5 /generic/tclTest.c
parent3c51da6d9db3a5e20f2e38f667ef5c0791b2e88d (diff)
downloadtcl-a5499a51a90ae1c06f3f39ee05c4b42185e0f28c.zip
tcl-a5499a51a90ae1c06f3f39ee05c4b42185e0f28c.tar.gz
tcl-a5499a51a90ae1c06f3f39ee05c4b42185e0f28c.tar.bz2
fix 5 small filesystem bugs, and some typos
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r--generic/tclTest.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index cd6acc4..852a2d1 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTest.c,v 1.64 2003/03/09 14:22:06 kennykb Exp $
+ * RCS: @(#) $Id: tclTest.c,v 1.65 2003/04/11 15:59:58 vincentdarley Exp $
*/
#define TCL_TEST
@@ -3339,12 +3339,26 @@ TestregexpObjCmd(dummy, interp, objc, objv)
char *varName;
CONST char *value;
int start, end;
- char info[TCL_INTEGER_SPACE * 2];
+ char resinfo[TCL_INTEGER_SPACE * 2];
varName = Tcl_GetString(objv[2]);
TclRegExpRangeUniChar(regExpr, -1, &start, &end);
- sprintf(info, "%d %d", start, end-1);
- value = Tcl_SetVar(interp, varName, info, 0);
+ sprintf(resinfo, "%d %d", start, end-1);
+ value = Tcl_SetVar(interp, varName, resinfo, 0);
+ if (value == NULL) {
+ Tcl_AppendResult(interp, "couldn't set variable \"",
+ varName, "\"", (char *) NULL);
+ return TCL_ERROR;
+ }
+ } else if (cflags & TCL_REG_CANMATCH) {
+ char *varName;
+ CONST char *value;
+ char resinfo[TCL_INTEGER_SPACE * 2];
+
+ Tcl_RegExpGetInfo(regExpr, &info);
+ varName = Tcl_GetString(objv[2]);
+ sprintf(resinfo, "%d", info.extendStart);
+ value = Tcl_SetVar(interp, varName, resinfo, 0);
if (value == NULL) {
Tcl_AppendResult(interp, "couldn't set variable \"",
varName, "\"", (char *) NULL);
@@ -3463,6 +3477,10 @@ TestregexpXflags(string, length, cflagsPtr, eflagsPtr)
cflags &= ~REG_ADVANCED;
break;
}
+ case 'c': {
+ cflags |= TCL_REG_CANMATCH;
+ break;
+ }
case 'e': {
cflags &= ~REG_ADVANCED;
cflags |= REG_EXTENDED;
@@ -4014,7 +4032,7 @@ TestfileCmd(dummy, interp, argc, argv)
}
for (j = i; j < argc; j++) {
- if (Tcl_FSGetTranslatedPath(interp, argv[j]) == NULL) {
+ if (Tcl_FSGetNormalizedPath(interp, argv[j]) == NULL) {
return TCL_ERROR;
}
}