[PD-dev] [ pure-data-Bugs-1359216 ] print character 123 freezes gui

Thomas Grill gr at grrrr.org
Mon Dec 5 01:51:43 CET 2005


Am 04.12.2005 um 17:27 schrieb Hans-Christoph Steiner:

>
> On Dec 3, 2005, at 3:08 AM, Mathieu Bouchard wrote:
>
>> On Sat, 3 Dec 2005, Thomas Grill wrote:
>>
>>>> fixed in DesireData today.
>>> Hi Mathieu,
>>> since DesireData is not actually usable, could you post a patch or 
>>> outline
>>> what the solution looks like so that it can be fixed in PD?
>>
>>         char t[MAXPDSTRING];
>>         int i,j=0;
>>         for(i=0; s[i] && j<MAXPDSTRING-16; i++) {
>>             if (index("\\\"[]$\n",s[i])) t[j++]='\\';
>> 	    t[j++] = s[i]=='\n' ? 'n' : s[i];
>>         }
>>         t[j] = 0;
>>         sys_vgui("pdtk_post \"%s\"\n",t);
>
> Any chance of getting this as a diff -uw against pd MAIN?

no diff, but the function dopost in s_print.c would be

static void dopost(const char *s)
{
     if (sys_printhook)
         (*sys_printhook)(s);
     else if (sys_printtostderr)
         fprintf(stderr, "%s", s);
     else
     {
         char upbuf[MAXPDSTRING];
         int i,j=0;
         for(i=0; s[i] && j<MAXPDSTRING-16; i++)
         {
             if (strchr("\\\"[]$\n",s[i])) upbuf[j++]='\\';
	    if (s[i]=='\n') upbuf[j++]='n'; else upbuf[j++] = s[i];
         }
         upbuf[j] = 0;

         sys_vgui("pdtk_post \"%s\"\n", upbuf);
     }
}


(corrected to be more portable and respect PD coding style)

Anyway, it doesn't work - PD still freezes when i type { inside an 
object window ("{: dropped" can't be printed)

best,
Thomas





More information about the Pd-dev mailing list