shithub: castor9

Download patch

ref: a26419bfecd8f5f3174b487c51c9552f8cde62fe
parent: 2be78fb328da9e2e6714d73c9b0c90e6751aaa80
author: Julien Blanchard <[email protected]>
date: Thu Dec 31 08:44:41 EST 2020

Move replace_char to util.c

binary files /dev/null b/castor.6 differ
--- a/castor.c
+++ b/castor.c
@@ -75,16 +75,6 @@
 };
 
 
-char* 
-replace_char(char* str, char find, char replace)
-{
-	char *current_pos = strchr(str,find);
-	while(current_pos){
-		*current_pos = replace;
-		current_pos = strchr(current_pos,find);
-	}
-	return str;
-}
 
 char*
 cleanup(char *line)
--- a/castor.h
+++ b/castor.h
@@ -29,6 +29,7 @@
 void *emalloc(int n);
 char *estrdup(char *s);
 int strbeg(char* str, char *prefix);
+char *replace_char(char *s, char f, char r);
 
 /* url.c */
 int	Efmt(Fmt*);