Index: ChangeLog =================================================================== diff -u -rba364529cbe05cbf9acf64aa728bf7316c8b4af7 -r519b71305f345f406448f602ad89be43371339cb --- ChangeLog (.../ChangeLog) (revision ba364529cbe05cbf9acf64aa728bf7316c8b4af7) +++ ChangeLog (.../ChangeLog) (revision 519b71305f345f406448f602ad89be43371339cb) @@ -1,14 +1,18 @@ 2007-10-29: * return mixins before procs in procsearch * added regression test + * Don't though error when the last argument of + "obj info class <...>" or "cl info superclass <....>" + is a non-existing class, but return false instead. + This leaves room for pattern matching. 2007-10-28: * some code refactoring * making new code more robust 2007-10-23: * First version of new info methods "mixinof" and "instmixinof" - - new class info options: mixinof instmixinof + - new class info options: "mixinof" and "instmixinof" - on class destroy entry is now removed from mixin and instmixin lists Index: generic/xotcl.c =================================================================== diff -u -rba364529cbe05cbf9acf64aa728bf7316c8b4af7 -r519b71305f345f406448f602ad89be43371339cb --- generic/xotcl.c (.../xotcl.c) (revision ba364529cbe05cbf9acf64aa728bf7316c8b4af7) +++ generic/xotcl.c (.../xotcl.c) (revision 519b71305f345f406448f602ad89be43371339cb) @@ -5975,7 +5975,7 @@ static int ListClass(Tcl_Interp *in, XOTclObject *obj, char *pattern, int objc, Tcl_Obj *CONST objv[]) { - if (pattern == 0) { + if (pattern == NULL) { Tcl_SetObjResult(in, obj->cl->object.cmdName); return TCL_OK; } else { @@ -5994,7 +5994,7 @@ static int ListSuperclasses(Tcl_Interp *in, XOTclClass *cl, char *pattern) { - if (pattern == 0) { + if (pattern == NULL) { XOTclClasses* sl = cl->super; XOTclClasses* sc = 0; @@ -6012,27 +6012,30 @@ } else { XOTclClass *isc = XOTclpGetClass(in, pattern); XOTclClasses* pl; - if (isc == 0) - return XOTclErrBadVal(in, "info superclass", "a class", pattern); - - /* - * search precedence to see if we're related or not - */ - for (pl = ComputeOrder(cl, cl->order, Super); pl; pl = pl->next) { - if (pl->cl == isc) { - Tcl_SetIntObj(Tcl_GetObjResult(in), 1); - break; + if (isc == 0) { + /* return XOTclErrBadVal(in, "info superclass", "a class", pattern);*/ + Tcl_SetIntObj(Tcl_GetObjResult(in), 0); + } else { + + /* + * search precedence to see if we're related or not + */ + for (pl = ComputeOrder(cl, cl->order, Super); pl; pl = pl->next) { + if (pl->cl == isc) { + Tcl_SetIntObj(Tcl_GetObjResult(in), 1); + break; + } } + if (pl == 0) + Tcl_SetIntObj(Tcl_GetObjResult(in), 0); } - if (pl == 0) - Tcl_SetIntObj(Tcl_GetObjResult(in), 0); } return TCL_OK; } static int ListSubclasses(Tcl_Interp *in, XOTclClass *cl, char *pattern) { - if (pattern == 0) { + if (pattern == NULL) { XOTclClasses* sl = cl->sub; XOTclClasses* sc = 0;