diff options
Diffstat (limited to 'libbb/replace.c')
| -rw-r--r-- | libbb/replace.c | 14 |
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 | |||
| 46 | //dbg_msg("subst9:'%s'", buf); | 46 | //dbg_msg("subst9:'%s'", buf); |
| 47 | return buf; | 47 | return buf; |
| 48 | } | 48 | } |
| 49 | |||
| 50 | #if 0 /* inlined in libbb.h */ | ||
| 51 | /* Returns strlen as a bonus */ | ||
| 52 | size_t FAST_FUNC replace_char(char *str, char from, char to) | ||
| 53 | { | ||
| 54 | char *p = str; | ||
| 55 | while (*p) { | ||
| 56 | if (*p == from) | ||
| 57 | *p = to; | ||
| 58 | p++; | ||
| 59 | } | ||
| 60 | return p - str; | ||
| 61 | } | ||
| 62 | #endif | ||
