summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/replace.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libbb/replace.c b/libbb/replace.c
index 6183d3e6f..bc26b04cc 100644
--- a/libbb/replace.c
+++ b/libbb/replace.c
@@ -46,3 +46,17 @@ char* FAST_FUNC xmalloc_substitute_string(const char *src, int count, const char
//dbg_msg("subst9:'%s'", buf);
return buf;
}
+
+#if 0 /* inlined in libbb.h */
+/* Returns strlen as a bonus */
+size_t FAST_FUNC replace_char(char *str, char from, char to)
+{
+ char *p = str;
+ while (*p) {
+ if (*p == from)
+ *p = to;
+ p++;
+ }
+ return p - str;
+}
+#endif