cvs commit: ALFS/nALFS/src init.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Mon May 31 13:25:44 PDT 2004


kpfleming    04/05/31 14:25:44

  Modified:    nALFS/src Tag: branch-1_2 init.c
  Log:
  make user-specific configuration file optional
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.13.4.1  +4 -4      ALFS/nALFS/src/init.c
  
  Index: init.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/init.c,v
  retrieving revision 1.13
  retrieving revision 1.13.4.1
  diff -u -r1.13 -r1.13.4.1
  --- init.c	7 Nov 2003 03:55:56 -0000	1.13
  +++ init.c	31 May 2004 20:25:44 -0000	1.13.4.1
  @@ -251,7 +251,6 @@
   /*
    * Read the "system" configuration file, /etc/nALFSrc.
    */
  -
   void read_system_rc_file(void)
   {
   	char system_rc_file[] = "/etc/nALFSrc";
  @@ -262,13 +261,13 @@
   }
   
   /*
  - * Constructs a full name of configuration file and calls a parser.
  + * Read the "user" configuration file, ~/.nALFSrc.
    */
   void read_user_rc_file(void)
   {
   	char *home_dir;
   	char *rcfile;
  -
  +	struct stat st;
   
   	home_dir = get_home_directory();
   
  @@ -281,7 +280,8 @@
   	append_str(&rcfile, "/");
   	append_str(&rcfile, RC_FILE_NAME);
   
  -	parse_rc_file(rcfile);
  +	if (!stat(rcfile, &st))
  +		parse_rc_file(rcfile);
   
   	xfree(rcfile);
   }
  
  
  



More information about the alfs-log mailing list