summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-03-28 10:56:38 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-03-28 10:56:38 (GMT)
commitaff97042289b6c2c5fd35cb8413deca7054ab0a7 (patch)
treeb1eb251e093eb5e8769f566c37b3c2b0dcde6982 /generic
parentebe7cfc96d8d03998cc3df2030e3d56733082640 (diff)
downloadtcl-aff97042289b6c2c5fd35cb8413deca7054ab0a7.zip
tcl-aff97042289b6c2c5fd35cb8413deca7054ab0a7.tar.gz
tcl-aff97042289b6c2c5fd35cb8413deca7054ab0a7.tar.bz2
Use the error messages generated by the variable management code rather than
creating our own in [regexp] and [regsub].
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCmdMZ.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 05f2e5d..e39ae06 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -383,12 +383,8 @@ Tcl_RegexpObjCmd(
return TCL_ERROR;
}
} else {
- Tcl_Obj *valuePtr;
-
- valuePtr = Tcl_ObjSetVar2(interp, objv[i], NULL, newPtr, 0);
- if (valuePtr == NULL) {
- Tcl_AppendResult(interp, "couldn't set variable \"",
- TclGetString(objv[i]), "\"", NULL);
+ if (Tcl_ObjSetVar2(interp, objv[i], NULL, newPtr,
+ TCL_LEAVE_ERR_MSG) == NULL) {
return TCL_ERROR;
}
}
@@ -816,9 +812,8 @@ Tcl_RegsubObjCmd(
Tcl_AppendUnicodeToObj(resultPtr, wstring + offset, wlen - offset);
}
if (objc == 4) {
- if (Tcl_ObjSetVar2(interp, objv[3], NULL, resultPtr, 0) == NULL) {
- Tcl_AppendResult(interp, "couldn't set variable \"",
- TclGetString(objv[3]), "\"", NULL);
+ if (Tcl_ObjSetVar2(interp, objv[3], NULL, resultPtr,
+ TCL_LEAVE_ERR_MSG) == NULL) {
result = TCL_ERROR;
} else {
/*