aboutsummaryrefslogtreecommitdiff
path: root/cyclone/hammer
diff options
context:
space:
mode:
authorN.N. <electrickery@users.sourceforge.net>2015-01-27 18:53:04 +0000
committerN.N. <electrickery@users.sourceforge.net>2015-01-27 18:53:04 +0000
commitf802a8da9d8d7e53f3407ae6771a7a4352b832fa (patch)
tree7a10214368a3df473a8b6490c8c8975d6414c098 /cyclone/hammer
parent24448e4c41ef24b2227bb6c11bf8869ca56843a6 (diff)
For cyclone/funbuff, filter out the non-object name part during file write, so it doesn't break while reading it back. Reported as bug #1188
svn path=/trunk/externals/miXed/; revision=17419
Diffstat (limited to 'cyclone/hammer')
-rw-r--r--cyclone/hammer/funbuff.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/cyclone/hammer/funbuff.c b/cyclone/hammer/funbuff.c
index 8328ffd..b5a8dbd 100644
--- a/cyclone/hammer/funbuff.c
+++ b/cyclone/hammer/funbuff.c
@@ -2,6 +2,7 @@
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+#include <libgen.h>
#include "m_pd.h"
#include "common/loud.h"
#include "common/vefl.h"
@@ -227,10 +228,16 @@ static void funbuff_dowrite(t_funbuff *x, t_symbol *fn)
t_binbuf *bb = binbuf_new();
char buf[MAXPDSTRING];
t_hammernode *np;
- binbuf_addv(bb, "s", atom_getsymbol(binbuf_getvec(x->x_ob.te_binbuf)));
+ /* specifying the object as cyclone/funbuff breaks the file writing/
+ * reading as the it doesn't start with 'funbuff'. A call to
+ * libgen/basename fixes this. fjk, 2015-01-24 */
+ t_symbol *objName = atom_getsymbol(binbuf_getvec(x->x_ob.te_binbuf));
+ objName->s_name = basename(objName->s_name);
+ binbuf_addv(bb, "s", objName);
for (np = x->x_tree.t_first; np; np = np->n_next)
binbuf_addv(bb, "if", np->n_key, HAMMERNODE_GETFLOAT(np));
canvas_makefilename(x->x_canvas, fn->s_name, buf, MAXPDSTRING);
+
binbuf_write(bb, buf, "", 0);
binbuf_free(bb);
}
@@ -270,7 +277,7 @@ static void funbuff_read(t_funbuff *x, t_symbol *s)
a bug? but CHECKME other classes (cf seq's filetype dilemma) */
static void funbuff_write(t_funbuff *x, t_symbol *s)
{
- if (s && s != &s_)
+ if (s && s != &s_)
funbuff_dowrite(x, s);
else /* CHECKME default name */
hammerpanel_save(x->x_filehandle,
@@ -523,4 +530,6 @@ void funbuff_setup(void)
gensym("debug"), A_DEFFLOAT, 0);
#endif
hammerfile_setup(funbuff_class, 1);
+ logpost(NULL, 4, "this is cyclone/funbuff %s, %dth %s build",
+ CYCLONE_VERSION, CYCLONE_BUILD, CYCLONE_RELEASE);
}