diff options
Diffstat (limited to 'bstr.c')
-rw-r--r-- | bstr.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -185,6 +185,14 @@ struct bstr *bstr_splitlines(void *talloc_ctx, struct bstr str) return r; } +bool bstr_eatstart(struct bstr *s, struct bstr prefix) +{ + if (!bstr_startswith(*s, prefix)) + return false; + *s = bstr_cut(*s, prefix.len); + return true; +} + void bstr_lower(struct bstr str) { for (int i = 0; i < str.len; i++) |