aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--externals/vanilla/print.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/externals/vanilla/print.c b/externals/vanilla/print.c
index 7857454d..954ffa1d 100644
--- a/externals/vanilla/print.c
+++ b/externals/vanilla/print.c
@@ -19,12 +19,28 @@ typedef struct _print
static void *print_new(t_symbol *sel, int argc, t_atom *argv)
{
t_print *x = (t_print *)pd_new(print_class);
- t_symbol *s = atom_getsymbolarg(0, argc, argv);
- if (!*s->s_name)
+ if (argc == 0)
x->x_sym = gensym("print");
- else if (!strcmp(s->s_name, "-n"))
+ else if (argc == 1 && argv->a_type == A_SYMBOL)
+ {
+ t_symbol *s = atom_getsymbolarg(0, argc, argv);
+ if (!strcmp(s->s_name, "-n"))
x->x_sym = &s_;
else x->x_sym = s;
+ }
+ else
+ {
+ int bufsize;
+ char *buf;
+ t_binbuf *bb = binbuf_new();
+ binbuf_add(bb, argc, argv);
+ binbuf_gettext(bb, &buf, &bufsize);
+ buf = resizebytes(buf, bufsize, bufsize+1);
+ buf[bufsize] = 0;
+ x->x_sym = gensym(buf);
+ freebytes(buf, bufsize+1);
+ binbuf_free(bb);
+ }
return (x);
}