aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormescalinum <mescalinum@users.sourceforge.net>2011-11-15 07:49:20 +0000
committermescalinum <mescalinum@users.sourceforge.net>2011-11-15 07:49:20 +0000
commit27992fb1ac4b86097a3fefa3b13f4d150a44aa03 (patch)
tree266556307f9b0ec29219ad42578600a9bbd279a9
parent1cfa4de1d848808738c9123a85764cd23f7b61d5 (diff)
fixed bug 3436716
svn path=/trunk/externals/loaders/tclpd/; revision=15748
-rw-r--r--tcl_class.c17
-rw-r--r--tcl_loader.c2
-rw-r--r--tclpd.h1
3 files changed, 17 insertions, 3 deletions
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) {
diff --git a/tcl_loader.c b/tcl_loader.c
index 8d07bf7..a572c43 100644
--- a/tcl_loader.c
+++ b/tcl_loader.c
@@ -69,7 +69,7 @@ found:
verbose(-1, "tclpd loader: loading tcl file %s", filename);
result = Tcl_EvalFile(tclpd_interp, filename);
if(result == TCL_OK) {
- source_table_add(objectname, filename);
+ source_table_add(classname, filename);
verbose(0, "tclpd loader: loaded %s", filename);
} else {
error("tclpd loader: error trying to load %s", filename);
diff --git a/tclpd.h b/tclpd.h
index 1fddff7..20afc83 100644
--- a/tclpd.h
+++ b/tclpd.h
@@ -17,7 +17,6 @@
typedef struct _t_tcl {
t_object o;
int ninlets; /* used for proxy inlet count */
- t_glist *x_glist;
char *source_file;