aboutsummaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index 8febc91..c90ff9f 100644
--- a/buffer.c
+++ b/buffer.c
@@ -804,6 +804,20 @@ string_mod_const (const char *str,
return NULL;
}
+void
+string_replace_leading (char *str, const char match, const char replace)
+{
+ ASSERT (match != '\0');
+ while (*str)
+ {
+ if (*str == match)
+ *str = replace;
+ else
+ break;
+ ++str;
+ }
+}
+
#ifdef CHARACTER_CLASS_DEBUG
#define CC_INCLUDE (CC_PRINT)