[PD-cvs] pd/src desire.c,1.1.2.217.2.172,1.1.2.217.2.173

Mathieu Bouchard matju at users.sourceforge.net
Fri Jul 20 05:58:42 CEST 2007


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9547

Modified Files:
      Tag: desiredata
	desire.c 
Log Message:
removed some MAXPDSTRING


Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.172
retrieving revision 1.1.2.217.2.173
diff -C2 -d -r1.1.2.217.2.172 -r1.1.2.217.2.173
*** desire.c	19 Jul 2007 22:37:40 -0000	1.1.2.217.2.172
--- desire.c	20 Jul 2007 03:58:37 -0000	1.1.2.217.2.173
***************
*** 5711,5720 ****
  static void canvas_object_help(t_canvas *x, t_symbol *name) {
  	t_text *o = symbol2opointer(name); if (!o) return;
!         char namebuf[MAXPDSTRING];
!         t_class *c = o->_class;
!         strcpy(namebuf, class_gethelpname(c));
!         char *dir = c->externdir->name;
!         if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd");
!         open_via_helppath(namebuf, dir);
  }
  
--- 5711,5720 ----
  static void canvas_object_help(t_canvas *x, t_symbol *name) {
  	t_text *o = symbol2opointer(name); if (!o) return;
!         const char *hn = class_gethelpname(o->_class);
!         bool suffixed = strcmp(hn+strlen(hn)-3, ".pd")==0;
! 	char *buf;
! 	asprintf(&buf,"%s%s",hn,suffixed?"":".pd");
!         open_via_helppath(buf, o->_class->externdir->name);
! 	free(buf);
  }
  
***************
*** 6851,6858 ****
          }
      }
!     *dirresult = (char *)malloc(MAXPDSTRING);
!     int r = open_via_path((x ? canvas_getdir(x)->name : "."), name, ext, *dirresult, nameresult, MAXPDSTRING, bin);
!     if (r<0) {free(*dirresult); *dirresult = 0;}
!     return r;
  }
  /* end miller 0.40 */
--- 6851,6855 ----
          }
      }
!     return  open_via_path2((x ? canvas_getdir(x)->name : "."), name, ext, dirresult, nameresult, bin);
  }
  /* end miller 0.40 */
***************
*** 6976,6984 ****
  		pd_free(newest);
  	}
!         char namebuf[MAXPDSTRING];
!         strcpy(namebuf, class_gethelpname(c));
!         char *dir = c->externdir->name;
!         if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd");
!         open_via_helppath(namebuf, dir);
  }
  
--- 6973,6982 ----
  		pd_free(newest);
  	}
!         const char *hn = class_gethelpname(c);
!         char *buf;
!         bool suffixed = strcmp(hn+strlen(hn)-3, ".pd")==0;
! 	asprintf(&buf,"%s%s",hn,suffixed?"":".pd");
!         open_via_helppath(buf, c->externdir->name);
! 	free(buf);
  }
  
***************
*** 7183,7192 ****
  
  static void openit(const char *dirname, const char *filename) {
!     char dirbuf[MAXPDSTRING];
      char *nameptr;
!     int fd = open_via_path(dirname,filename,"",dirbuf,&nameptr,MAXPDSTRING,0);
      if (!fd) {error("%s: can't open", filename); return;}
      close(fd);
      glob_evalfile(0, gensym(nameptr), gensym(dirbuf));
  }
  
--- 7181,7191 ----
  
  static void openit(const char *dirname, const char *filename) {
!     char *dirbuf;
      char *nameptr;
!     int fd = open_via_path2(dirname,filename,"",&dirbuf,&nameptr,0);
      if (!fd) {error("%s: can't open", filename); return;}
      close(fd);
      glob_evalfile(0, gensym(nameptr), gensym(dirbuf));
+     free(dirbuf);
  }
  





More information about the Pd-cvs mailing list