[PD-cvs] pd/src s_path.c,1.1.1.2.2.2.2.1,1.1.1.2.2.2.2.2

Mathieu Bouchard matju at users.sourceforge.net
Sun Mar 28 01:02:32 CET 2004


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

Modified Files:
      Tag: impd_0_37
	s_path.c 
Log Message:
now reads ~/.impdrc (if present) instead of ~/.pdrc


Index: s_path.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_path.c,v
retrieving revision 1.1.1.2.2.2.2.1
retrieving revision 1.1.1.2.2.2.2.2
diff -C2 -d -r1.1.1.2.2.2.2.1 -r1.1.1.2.2.2.2.2
*** s_path.c	22 Feb 2004 05:23:52 -0000	1.1.1.2.2.2.2.1
--- s_path.c	28 Mar 2004 00:02:30 -0000	1.1.1.2.2.2.2.2
***************
*** 84,88 ****
      const char *npos;
      char temp[MAXPDSTRING];
!     t_namelist *nl = listwas, *rtn = listwas;
      
      npos = s;
--- 84,88 ----
      const char *npos;
      char temp[MAXPDSTRING];
!     t_namelist *nl = listwas;
      
      npos = s;
***************
*** 94,98 ****
      }
  	while (npos);
!     return (nl);
  }
  
--- 94,98 ----
      }
  	while (npos);
!     return nl;
  }
  
***************
*** 253,257 ****
  #endif
      	    {
- 	    	char *slash;
  		if (sys_verbose) post("tried %s and succeeded", dirresult);
  		sys_unbashfilename(dirresult, dirresult);
--- 253,256 ----
***************
*** 274,279 ****
  void open_via_helppath(const char *name, const char *dir)
  {
!     t_namelist *nl, thislist, *listp;
!     int fd = -1;
      char dirbuf2[MAXPDSTRING], realname[MAXPDSTRING];
  
--- 273,277 ----
  void open_via_helppath(const char *name, const char *dir)
  {
!     t_namelist thislist, *listp;
      char dirbuf2[MAXPDSTRING], realname[MAXPDSTRING];
  
***************
*** 316,320 ****
  #ifdef UNIX
  
- #define STARTUPNAME ".pdrc"
  #define NUMARGS 1000
  
--- 314,317 ----
***************
*** 324,348 ****
  {
      FILE* file;
!     int i;
!     int k;
!     int rcargc;
!     char* rcargv[NUMARGS];
!     char* buffer;
      char  fname[MAXPDSTRING], buf[1000], *home = getenv("HOME");
  
      /* parse a startup file */
      
!     *fname = '\0'; 
! 
!     strncat(fname, home? home : ".", MAXPDSTRING-10);
!     strcat(fname, "/");
! 
!     strcat(fname, STARTUPNAME);
! 
!     if (!(file = fopen(fname, "r")))
!     	return 1;
! 
!     post("reading startup file: %s", fname);
! 
      rcargv[0] = ".";	/* this no longer matters to sys_argparse() */
  
--- 321,342 ----
  {
      FILE* file;
!     int i,j,k,rcargc;
!     char *rcargv[NUMARGS], *buffer;
      char  fname[MAXPDSTRING], buf[1000], *home = getenv("HOME");
+     static char *names[] = {".impdrc",".pdrc"};
  
      /* parse a startup file */
+     for (j=0; j<2; j++) {
+ 	*fname = '\0'; 
+ 	snprintf(fname,MAXPDSTRING,"%s/%s",
+ 		home? home : ".", names[j]);
+ 	file = fopen(fname, "r");
+ 	if (file) {
+ 		post("reading startup file: %s", fname);
+ 		goto got_one;
+ 	}
+     }
      
!     got_one:
      rcargv[0] = ".";	/* this no longer matters to sys_argparse() */
  





More information about the Pd-cvs mailing list