Changeset - e1169a0b7eae
[Not reviewed]
default
0 1 0
ethanzonca@zserver2 - 16 years ago 2009-12-19 21:52:20

Fixed conf replacer
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/server/slavefuncs.c
Show inline comments
 
@@ -219,14 +219,14 @@ int login_user(char *username)
 

	
 
/** Replaces wordtoreplace with replacewith in conffile (relative to SYSCONFDIR) */
 
int conf_replace(char *conffile, char *wordtoreplace, char *replacewith){
 
  int maxlinelen = 120;
 
  char *fileOrig;
 
  char *fileRepl;
 
  _distren_asprintf(&fileOrig, "&s&s", SYSCONFDIR, conffile);
 
  _distren_asprintf(&fileRepl, "&s&s.edited", SYSCONFDIR, conffile);
 
  _distren_asprintf(&fileOrig, "%s/%s", SYSCONFDIR, conffile);
 
  _distren_asprintf(&fileRepl, "%s%s.edited", SYSCONFDIR, conffile);
 
  char buffer[maxlinelen+2];
 
  char *buff_ptr, *find_ptr;
 
  FILE *fp1, *fp2;
 
  size_t find_len = strlen(wordtoreplace);
 
  fp1 = fopen(fileOrig,"r");
 
  fp2 = fopen(fileRepl,"w");
0 comments (0 inline, 0 general)