summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-08-25 21:28:26 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-08-25 21:28:26 (GMT)
commitd6d4bb969fa1616d93e6a3f125308a6c386af51e (patch)
treee8d1b28362b6d5cc0cfc3043f2f0bc6dd0159501 /generic
parent6edc52fd6815d3479ca129e736b123fce6de7512 (diff)
downloadtcl-d6d4bb969fa1616d93e6a3f125308a6c386af51e.zip
tcl-d6d4bb969fa1616d93e6a3f125308a6c386af51e.tar.gz
tcl-d6d4bb969fa1616d93e6a3f125308a6c386af51e.tar.bz2
Fixes to ensemble -unknown handler processing to stop [namespace import] from
disrupting things horribly. Problem found by Don Porter when investigating [Bug 1016167].
Diffstat (limited to 'generic')
-rw-r--r--generic/tclNamesp.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index e38f2da..d1da5ae 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -21,7 +21,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.44 2004/08/03 21:46:55 dkf Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.45 2004/08/25 21:28:26 dkf Exp $
*/
#include "tclInt.h"
@@ -4933,22 +4933,12 @@ NsEnsembleImplementationCmd(clientData, interp, objc, objv)
if (ensemblePtr->unknownHandler != NULL && reparseCount++ < 1) {
int paramc, i;
- Tcl_Obj **paramv, *unknownCmd;
- char *ensName = TclGetString(objv[0]);
+ Tcl_Obj **paramv, *unknownCmd, *ensObj;
unknownCmd = Tcl_DuplicateObj(ensemblePtr->unknownHandler);
- if (ensName[0] == ':') {
- Tcl_ListObjAppendElement(NULL, unknownCmd, objv[0]);
- } else {
- Tcl_Obj *qualEnsembleObj =
- Tcl_NewStringObj(Tcl_GetCurrentNamespace(interp)->fullName,-1);
- if (Tcl_GetCurrentNamespace(interp)->parentPtr) {
- Tcl_AppendStringsToObj(qualEnsembleObj, "::", ensName, NULL);
- } else {
- Tcl_AppendStringsToObj(qualEnsembleObj, ensName, NULL);
- }
- Tcl_ListObjAppendElement(NULL, unknownCmd, qualEnsembleObj);
- }
+ TclNewObj(ensObj);
+ Tcl_GetCommandFullName(interp, ensemblePtr->token, ensObj);
+ Tcl_ListObjAppendElement(NULL, unknownCmd, ensObj);
for (i=1 ; i<objc ; i++) {
Tcl_ListObjAppendElement(NULL, unknownCmd, objv[i]);
}