summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-12-23 11:01:56 +0100
committerwm4 <wm4@nowhere>2019-12-23 11:01:56 +0100
commitba45b67370a8881a2bdf80e510861a7a5d20bc31 (patch)
treecfe9ea28fa8b40b7db0fb326eca01eaa257c6923 /misc
parentcd09ea92bec55ee0faf31c5a1e27d52dddf057b5 (diff)
downloadmpv-ba45b67370a8881a2bdf80e510861a7a5d20bc31.tar.bz2
mpv-ba45b67370a8881a2bdf80e510861a7a5d20bc31.tar.xz
bstr: remove unused bstr_splitlines() function
Diffstat (limited to 'misc')
-rw-r--r--misc/bstr.c22
-rw-r--r--misc/bstr.h1
2 files changed, 0 insertions, 23 deletions
diff --git a/misc/bstr.c b/misc/bstr.c
index 772ca9c66d..4f1e8629b3 100644
--- a/misc/bstr.c
+++ b/misc/bstr.c
@@ -191,28 +191,6 @@ double bstrtod(struct bstr str, struct bstr *rest)
return r;
}
-struct bstr *bstr_splitlines(void *talloc_ctx, struct bstr str)
-{
- if (str.len == 0)
- return NULL;
- int count = 0;
- for (int i = 0; i < str.len; i++)
- if (str.start[i] == '\n')
- count++;
- if (str.start[str.len - 1] != '\n')
- count++;
- struct bstr *r = talloc_array_ptrtype(talloc_ctx, r, count);
- unsigned char *p = str.start;
- for (int i = 0; i < count - 1; i++) {
- r[i].start = p;
- while (*p++ != '\n');
- r[i].len = p - r[i].start;
- }
- r[count - 1].start = p;
- r[count - 1].len = str.start + str.len - p;
- return r;
-}
-
struct bstr bstr_splitchar(struct bstr str, struct bstr *rest, const char c)
{
int pos = bstrchr(str, c);
diff --git a/misc/bstr.h b/misc/bstr.h
index d6e2fdc18e..dc8ad4030c 100644
--- a/misc/bstr.h
+++ b/misc/bstr.h
@@ -69,7 +69,6 @@ int bstrspn(struct bstr str, const char *accept);
int bstrcspn(struct bstr str, const char *reject);
int bstr_find(struct bstr haystack, struct bstr needle);
-struct bstr *bstr_splitlines(void *talloc_ctx, struct bstr str);
struct bstr bstr_lstrip(struct bstr str);
struct bstr bstr_strip(struct bstr str);
struct bstr bstr_split(struct bstr str, const char *sep, struct bstr *rest);