Signed-off-by: Geoff Levand <geoff@infradead.org>
return strlen(s) ? s : NULL;
}
return strlen(s) ? s : NULL;
}
+/**
+ * conf_replace_char - replace one char with another.
+ */
+
+char *conf_replace_char(char *s, char from, char to)
+{
+ if (!s)
+ return NULL;
+
+ for ( ; *s; s++)
+ if (*s == from)
+ *s = to;
+
+ return s;
+}
+
/**
* conf_get_param_pair - Get the next 'name=value' parameter pair.
* @str: The string to process.
/**
* conf_get_param_pair - Get the next 'name=value' parameter pair.
* @str: The string to process.
int conf_param_in_list(const char *const *list, const char *param);
char *conf_strip_str(char *s);
int conf_param_in_list(const char *const *list, const char *param);
char *conf_strip_str(char *s);
+char *conf_replace_char(char *s, char from, char to);