Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14804
Modified Files: Tag: devel_0_39 s_path.c Log Message: in Tim's pdrc comment code, fixed mishandling of whitespace fixed memory corruption for line too long
Index: s_path.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_path.c,v retrieving revision 1.3.4.6.2.6 retrieving revision 1.3.4.6.2.7 diff -C2 -d -r1.3.4.6.2.6 -r1.3.4.6.2.7 *** s_path.c 21 Apr 2006 08:46:14 -0000 1.3.4.6.2.6 --- s_path.c 7 Aug 2006 07:07:31 -0000 1.3.4.6.2.7 *************** *** 403,413 **** if (c[0] != '#') { ! while (sscanf(c,"%999s",buf) != EOF) { ! buf[1000] = 0; if (!(rcargv[i] = (char *)malloc(strlen(buf) + 1))) goto cleanup; strcpy(rcargv[i], buf); ! strcpy(buf,c+strlen(buf)+1); strcpy(c,buf); ++i; --- 403,414 ---- if (c[0] != '#') { ! long n; ! while (sscanf(c,"%999s%n",buf,&n) != EOF) { ! buf[999] = 0; if (!(rcargv[i] = (char *)malloc(strlen(buf) + 1))) goto cleanup; strcpy(rcargv[i], buf); ! strcpy(buf,c+n); strcpy(c,buf); ++i; *************** *** 445,449 **** for (i = 1; i < NUMARGS-1; i++) if(rcargv[i])free(rcargv[i]); ! return(retval); } --- 446,450 ---- for (i = 1; i < NUMARGS-1; i++) if(rcargv[i])free(rcargv[i]); ! return(retval); } *************** *** 457,461 **** { char fname[MAXPDSTRING], *home = getenv("HOME"); ! // parse a startup file */ *fname = '\0'; --- 458,462 ---- { char fname[MAXPDSTRING], *home = getenv("HOME"); ! // parse a startup file */ *fname = '\0';