Commit 17c345d5 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*started cleaning up addbinbuf--it seems like comment object will need to be...

*started cleaning up addbinbuf--it seems like comment object will need to be treated differently from others as commas, semis, and other reserved characters have unexpected behaviors.
parent b0a1f0bb
......@@ -247,20 +247,27 @@ void binbuf_gettext(t_binbuf *x, char **bufp, int *lengthp)
char string[MAXPDSTRING];
t_atom *ap;
int indx;
int newlength;
for (ap = x->b_vec, indx = x->b_n; indx--; ap++)
{
int newlength;
//fprintf(stderr,"=====\n");
if ((ap->a_type == A_SEMI || ap->a_type == A_COMMA) &&
length && buf[length-1] == ' ') length--;
length && buf[length-1] == ' ')
{
//fprintf(stderr, "subtracting length\n");
length--;
}
atom_string(ap, string, MAXPDSTRING);
newlength = length + strlen(string) + 1;
if (!(newbuf = resizebytes(buf, length, newlength))) break;
buf = newbuf;
//fprintf(stderr,"string=<%s> buf=<%s> length=%d\n", string, buf, length);
strcpy(buf + length, string);
length = newlength;
if (ap->a_type == A_SEMI) buf[length-1] = '\n';
else buf[length-1] = ' ';
//if (ap->a_type == A_COMMA) length--;
}
if (length && buf[length-1] == ' ')
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment