src/util.c

changeset 11920
be80617ec59b
parent 11878
4c2661df91bb
child 12109
10f7b7f64648
--- a/src/util.c	Mon Oct 31 03:55:56 2005 +0000
+++ b/src/util.c	Mon Oct 31 04:27:06 2005 +0000
@@ -2465,19 +2465,35 @@
 }
 
 void
-gaim_str_strip_cr(char *text)
+gaim_str_strip_char(char *text, char thechar)
 {
 	int i, j;
 
 	g_return_if_fail(text != NULL);
 
 	for (i = 0, j = 0; text[i]; i++)
-		if (text[i] != '\r')
+		if (text[i] != thechar)
 			text[j++] = text[i];
 
 	text[j++] = '\0';
 }
 
+void
+gaim_util_chrreplace(char *string, char delimiter,
+					 char replacement)
+{
+	int i = 0;
+
+	g_return_if_fail(string != NULL);
+
+	while (string[i] != '\0')
+	{
+		if (string[i] == delimiter)
+			string[i] = replacement;
+		i++;
+	}
+}
+
 gchar *
 gaim_strreplace(const char *string, const char *delimiter,
 				const char *replacement)

mercurial