summaryrefslogtreecommitdiffstats
path: root/generic/tclScan.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-04-04 13:40:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-04-04 13:40:01 (GMT)
commit25e4dca4916e5ae7be29bb21c40e59f3adb4b5ec (patch)
treeeebeebaa58948935075500c432b9c53885fe1d6b /generic/tclScan.c
parent2205a28b9e00ec29977d2b21e2f2bda3b77aaaf4 (diff)
downloadtcl-25e4dca4916e5ae7be29bb21c40e59f3adb4b5ec.zip
tcl-25e4dca4916e5ae7be29bb21c40e59f3adb4b5ec.tar.gz
tcl-25e4dca4916e5ae7be29bb21c40e59f3adb4b5ec.tar.bz2
Better error-message in case of errors related to setting a variable
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r--generic/tclScan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 68b8d21..06e66e4 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -1001,10 +1001,10 @@ Tcl_ScanObjCmd(
continue;
}
result++;
-#warning Why make your own error message? Why?
- if (Tcl_ObjSetVar2(interp, objv[i+3], NULL, objs[i], 0) == NULL) {
- Tcl_AppendResult(interp, "couldn't set variable \"",
- TclGetString(objv[i+3]), "\"", NULL);
+ /* In case of multiple errors in setting variables, just report
+ * the first one. */
+ if (Tcl_ObjSetVar2(interp, objv[i+3], NULL, objs[i],
+ (code == TCL_OK) ? TCL_LEAVE_ERR_MSG : 0) == NULL) {
code = TCL_ERROR;
}
Tcl_DecrRefCount(objs[i]);