diff --git a/src/m_binbuf.c b/src/m_binbuf.c index 9176804260014e0c4c1b13822e491a37ab51fb74..47fca2f8c1c228eddab6df718b23b31e7d73f58e 100644 --- a/src/m_binbuf.c +++ b/src/m_binbuf.c @@ -608,9 +608,16 @@ void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv) t_atom *at = x->b_vec; int ac = x->b_n; int nargs, maxnargs = 0; - //if (ac <= SMALLMSG) - //IB added ac > argc check to allow for proper $@ arg (list) allocation - if (ac <= SMALLMSG && ac > argc) + //first we need to check if the list of arguments has $@ + int count; + for (count = 0; count < ac; count++) { + if (at[count].a_type == A_DOLLAR && at[count].a_w.w_symbol==gensym("@")) { + //fprintf(stderr,"yes %d %d %d\n", ac, argc, ac+argc-1); + ac = ac + argc; + } + } + + if (ac <= SMALLMSG) mstack = smallstack; else { @@ -623,15 +630,13 @@ void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv) destination in the message, only because the original "target" points there. */ if (target == &pd_objectmaker) { - //IB added ac > argc check to allow for proper $@ arg (list) allocation - maxnargs = (ac > argc ? ac : argc+1); - //if (at && x->b_n) - // fprintf(stderr,"pd_objectmaker %s %d\n", at[0].a_w.w_symbol->s_name, maxnargs); + maxnargs = ac; + //if (at && x->b_n) fprintf(stderr,"pd_objectmaker %s %d %d %d\n", at[0].a_w.w_symbol->s_name, ac, argc, maxnargs); } else { int i, j = (target ? 0 : -1); - for (i = 0; i < (ac > argc ? ac : argc); i++) + for (i = 0; i < ac; i++) { if (at[i].a_type == A_SEMI) j = -1; @@ -755,6 +760,7 @@ void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv) { *msp++=argv[i]; nargs++; + ac--; } msp--; nargs--; diff --git a/src/m_pd.h b/src/m_pd.h index ad6b976be0fecd943bfbfc2b1db968d93870181e..f1c4f95b0fb1a982b1459a5565bd6b9aa58c6021 100644 --- a/src/m_pd.h +++ b/src/m_pd.h @@ -11,7 +11,7 @@ extern "C" { #define PD_MAJOR_VERSION 0 #define PD_MINOR_VERSION 42 #define PD_BUGFIX_VERSION 5 -#define PD_TEST_VERSION "extended-l2ork-20110310" +#define PD_TEST_VERSION "extended-l2ork-20110312" /* old name for "MSW" flag -- we have to take it for the sake of many old "nmakefiles" for externs, which will define NT and not MSW */