Fix for methods with similar names when showing list of names on error - bug #1191828. Patch from Jeroen Dobbelaere.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7203 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c5b8ac0fc7
commit
2ba3b19c02
1 changed files with 14 additions and 1 deletions
|
|
@ -605,7 +605,20 @@ SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_
|
||||||
meth = cls->methods;
|
meth = cls->methods;
|
||||||
while (meth && meth->name) {
|
while (meth && meth->name) {
|
||||||
char *cr = (char *) Tcl_GetStringResult(interp);
|
char *cr = (char *) Tcl_GetStringResult(interp);
|
||||||
if (!strstr(strchr(cr,':'), meth->name))
|
int meth_len = strlen(meth->name);
|
||||||
|
char* where = strchr(cr,':');
|
||||||
|
while(where) {
|
||||||
|
where = strstr(where, meth->name);
|
||||||
|
if(where) {
|
||||||
|
if(where[-1] == ' ' && (where[meth_len] == ' ' || where[meth_len]==0)) {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
where++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!where)
|
||||||
Tcl_AppendElement(interp, (char *) meth->name);
|
Tcl_AppendElement(interp, (char *) meth->name);
|
||||||
meth++;
|
meth++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue