From 27992fb1ac4b86097a3fefa3b13f4d150a44aa03 Mon Sep 17 00:00:00 2001 From: mescalinum Date: Tue, 15 Nov 2011 07:49:20 +0000 Subject: fixed bug 3436716 svn path=/trunk/externals/loaders/tclpd/; revision=15748 --- tcl_class.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'tcl_class.c') diff --git a/tcl_class.c b/tcl_class.c index 46870e8..fc4136d 100644 --- a/tcl_class.c +++ b/tcl_class.c @@ -94,10 +94,25 @@ t_tcl * tclpd_new(t_symbol *classsym, int ac, t_atom *at) { // lookup in class table const char *name = classsym->s_name; t_class *qlass = class_table_get(name); + while(!qlass) { + // try progressively skipping namespace/ prefixes (bug 3436716) + name = strchr(name, '/'); + if(!name || !*++name) break; + qlass = class_table_get(name); + } + if(!qlass) { + error("tclpd: class not found: %s", name); + return NULL; + } t_tcl *x = (t_tcl *)pd_new(qlass); + if(!x) { + error("tclpd: failed to create object of class %s", name); + return NULL; + } + + /* used for numbering proxy inlets: */ x->ninlets = 1 /* qlass->c_firstin ??? */; - x->x_glist = (t_glist *)canvas_getcurrent(); x->source_file = (char *)hashtable_get(source_table, name); if(!x->source_file) { -- cgit v1.2.1