diff options
author | dkf <dkf@noemail.net> | 2011-03-28 10:56:38 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2011-03-28 10:56:38 (GMT) |
commit | 01a10d594680167333770da507bd8ec2ad418eba (patch) | |
tree | b1eb251e093eb5e8769f566c37b3c2b0dcde6982 /generic/tclCmdMZ.c | |
parent | 429717e932c04de60658b2de9a7a88ef40b9f4f9 (diff) | |
download | tcl-01a10d594680167333770da507bd8ec2ad418eba.zip tcl-01a10d594680167333770da507bd8ec2ad418eba.tar.gz tcl-01a10d594680167333770da507bd8ec2ad418eba.tar.bz2 |
Use the error messages generated by the variable management code rather than
creating our own in [regexp] and [regsub].
FossilOrigin-Name: 2f614e5f12241bd9ca500cfc606b6692b74a75e4
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r-- | generic/tclCmdMZ.c | 13 |
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 { /* |