X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fparser-conf.c;h=6926a92a3fc3b836f51353ec71d3f9b920c43812;hp=88e96b7bee9e149d8e0cc58f93a156b9779c7193;hb=59c55e2b636c0f877d36dbd158ede80a6dbf7ae3;hpb=3f82d6fc10a582ba3f558b69c14ab4ab7234e5ea diff --git a/discover/parser-conf.c b/discover/parser-conf.c index 88e96b7..6926a92 100644 --- a/discover/parser-conf.c +++ b/discover/parser-conf.c @@ -57,6 +57,22 @@ char *conf_strip_str(char *s) 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.