summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorrjohnson <rjohnson>1998-07-01 18:38:11 (GMT)
committerrjohnson <rjohnson>1998-07-01 18:38:11 (GMT)
commit38a602fd9e55eb27860fa611014f0f088a643e5b (patch)
tree4c7639deefaccbbf761efe51d87d74959f774757 /generic
parent7e69dded97f0a1672c612f4b4399ce422bd021f6 (diff)
downloadtcl-38a602fd9e55eb27860fa611014f0f088a643e5b.zip
tcl-38a602fd9e55eb27860fa611014f0f088a643e5b.tar.gz
tcl-38a602fd9e55eb27860fa611014f0f088a643e5b.tar.bz2
changed TclFindProc & TclIsProc to understand aliased commands
Diffstat (limited to 'generic')
-rw-r--r--generic/tclProc.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 273f12f..61aaf15 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -502,14 +502,20 @@ TclFindProc(iPtr, procName)
char *procName; /* Name of desired procedure. */
{
Tcl_Command cmd;
+ Tcl_Command origCmd;
Command *cmdPtr;
-
+
cmd = Tcl_FindCommand((Tcl_Interp *) iPtr, procName,
(Tcl_Namespace *) NULL, /*flags*/ 0);
if (cmd == (Tcl_Command) NULL) {
return NULL;
}
cmdPtr = (Command *) cmd;
+
+ origCmd = TclGetOriginalCommand(cmd);
+ if (origCmd != NULL) {
+ cmdPtr = (Command *) origCmd;
+ }
if (cmdPtr->proc != InterpProc) {
return NULL;
}
@@ -524,7 +530,7 @@ TclFindProc(iPtr, procName)
* Tells whether a command is a Tcl procedure or not.
*
* Results:
- * If the given command is actuall a Tcl procedure, the
+ * If the given command is actually a Tcl procedure, the
* return value is the address of the record describing
* the procedure. Otherwise the return value is 0.
*
@@ -538,6 +544,12 @@ Proc *
TclIsProc(cmdPtr)
Command *cmdPtr; /* Command to test. */
{
+ Tcl_Command origCmd;
+
+ origCmd = TclGetOriginalCommand((Tcl_Command) cmdPtr);
+ if (origCmd != NULL) {
+ cmdPtr = (Command *) origCmd;
+ }
if (cmdPtr->proc == InterpProc) {
return (Proc *) cmdPtr->clientData;
}