aboutsummaryrefslogtreecommitdiff
path: root/externals
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-02-20 18:32:53 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-02-20 18:32:53 +0000
commit7b65906d1a204c48d2f5a7ca6dad2002fa72b057 (patch)
treeb985930364177ff5e7b3b2ffc44a5d6cb9aeac56 /externals
parent89bc16599528f4978d3c7767be0561bb6c66cd86 (diff)
sync with x_interface.c from pure-data.git 0.43-1
svn path=/trunk/; revision=16006
Diffstat (limited to 'externals')
-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);
}