Index: ChangeLog =================================================================== diff -u -r83460374153c5fda6a3399ba671804a4337e04e3 -raeac917db741ab7500d7e976443ac551f191efcd --- ChangeLog (.../ChangeLog) (revision 83460374153c5fda6a3399ba671804a4337e04e3) +++ ChangeLog (.../ChangeLog) (revision aeac917db741ab7500d7e976443ac551f191efcd) @@ -1,3 +1,8 @@ +2008-05-26 + * fixed bug in info instdefault, when argument is an empty + string. Example: + X info instdefault crash "" var + 2008-05-09 * used catch in the deprecated package xotcl::upvar-compat as suggested by Jeff Hobbs Index: generic/predefined.h =================================================================== diff -u -r90f13fe04f5c707be3b56808a8a7992adab1855f -raeac917db741ab7500d7e976443ac551f191efcd --- generic/predefined.h (.../predefined.h) (revision 90f13fe04f5c707be3b56808a8a7992adab1855f) +++ generic/predefined.h (.../predefined.h) (revision aeac917db741ab7500d7e976443ac551f191efcd) @@ -285,9 +285,9 @@ "::xotcl::Object proc getExitHandler {} {\n" "::xotcl::Object info body __exitHandler}\n" "::xotcl::Object instproc abstract {methtype methname arglist} {\n" -"if {$methtype ne \"proc\" && $methtype ne \"instproc\"} {\n" +"if {$methtype ne \"proc\" && $methtype ne \"instproc\" && $methtype ne \"method\"} {\n" "error \"invalid method type '$methtype', \\\n" -"must be either 'proc' or 'instproc'.\"}\n" +"must be either 'proc', 'instproc' or 'method'.\"}\n" "::xotcl::my $methtype $methname $arglist \"\n" "if {!\\[::xotcl::self isnextcall\\]} {\n" "error \\\"Abstract method $methname $arglist called\\\"} else {::xotcl::next}\n" Index: generic/xotcl.c =================================================================== diff -u -r6ed4ee1fa83082cba7852aa3aa681351dbe8eea8 -raeac917db741ab7500d7e976443ac551f191efcd --- generic/xotcl.c (.../xotcl.c) (revision 6ed4ee1fa83082cba7852aa3aa681351dbe8eea8) +++ generic/xotcl.c (.../xotcl.c) (revision aeac917db741ab7500d7e976443ac551f191efcd) @@ -6464,9 +6464,13 @@ ordinaryArg = ordinaryArgsDefv[i]; rc = Tcl_ListObjGetElements(interp, ordinaryArg, &defaultValueObjc, &defaultValueObjv); - if (rc == TCL_OK && !strcmp(arg, ObjStr(defaultValueObjv[0]))) { - return SetProcDefault(interp, var, defaultValueObjc == 2 ? - defaultValueObjv[1] : NULL); + /*fprintf(stderr, "arg='%s', *arg==0 %d, defaultValueObjc=%d\n", arg, *arg==0, defaultValueObjc);*/ + if (rc == TCL_OK) { + if (defaultValueObjc > 0 && !strcmp(arg, ObjStr(defaultValueObjv[0]))) { + return SetProcDefault(interp, var, defaultValueObjc == 2 ? defaultValueObjv[1] : NULL); + } else if (defaultValueObjc == 0 && *arg == 0) { + return SetProcDefault(interp, var, NULL); + } } } XOTclVarErrMsg(interp, "method '", procName, "' doesn't have an argument '",