summaryrefslogtreecommitdiffstats
path: root/generic/tclAssembly.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-08-05 15:23:55 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-08-05 15:23:55 (GMT)
commit86876436a44b247ec6423fbead92b7c3ce8a2032 (patch)
tree8d196c86a7bd506d332c9e4b0da126e6f2ed45fd /generic/tclAssembly.c
parent6c25700250fe041510e2332ba954737b21f3146d (diff)
downloadtcl-86876436a44b247ec6423fbead92b7c3ce8a2032.zip
tcl-86876436a44b247ec6423fbead92b7c3ce8a2032.tar.gz
tcl-86876436a44b247ec6423fbead92b7c3ce8a2032.tar.bz2
Use Tcl_PrintfObj to generate more (complex) error messages.
Diffstat (limited to 'generic/tclAssembly.c')
-rw-r--r--generic/tclAssembly.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index eca934f..f45ae07 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -2292,15 +2292,12 @@ CheckNamespaceQualifiers(
const char* name, /* Variable name to check */
int nameLen) /* Length of the variable */
{
- Tcl_Obj* result; /* Error message */
const char* p;
for (p = name; p+2 < name+nameLen; p++) {
if ((*p == ':') && (p[1] == ':')) {
- result = Tcl_NewStringObj("variable \"", -1);
- Tcl_AppendToObj(result, name, -1);
- Tcl_AppendToObj(result, "\" is not local", -1);
- Tcl_SetObjResult(interp, result);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "variable \"%s\" is not local", name));
Tcl_SetErrorCode(interp, "TCL", "ASSEM", "NONLOCAL", name, NULL);
return TCL_ERROR;
}