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:
William S Fulton 2005-05-21 00:09:18 +00:00
commit 2ba3b19c02

View file

@ -605,7 +605,20 @@ SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_
meth = cls->methods;
while (meth && meth->name) {
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);
meth++;
}