diff options
Diffstat (limited to 'src/util.c')
| -rw-r--r-- | src/util.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c index 1ca9d850c..f47de9e53 100644 --- a/src/util.c +++ b/src/util.c @@ -156,6 +156,23 @@ void git__strtolower(char *str) git__strntolower(str, strlen(str)); } +size_t git__removechar(char *str, char remove) +{ + char *from = str, *to = str; + + while (*from) { + if (*from == remove) + from++; + if (to != from) + *to = *from; + to++; + from++; + } + *to = '\0'; + + return (to - str); +} + int git__prefixcmp(const char *str, const char *prefix) { for (;;) { |
