diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-07-20 04:41:51 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-07-20 04:41:51 +0300 |
commit | d6890a7b5390f1f227132be96c0c1ba998b1cdf3 (patch) | |
tree | 3d344933cb1d8a4f203ea5d768077fdd9221417c /bstr.h | |
parent | c2f5465bcc7af2f5caa88dea2c9aa2861e0311a6 (diff) | |
download | mpv-d6890a7b5390f1f227132be96c0c1ba998b1cdf3.tar.bz2 mpv-d6890a7b5390f1f227132be96c0c1ba998b1cdf3.tar.xz |
input: fix input.conf parse errors
Commit df899f59be removing a write outside a buffer triggered another
problem, as for some reason the code did not 0-terminate its read
buffer in the specific case that it had encountered an EOF, and as a
result could parse contents left in the buffer for a second time.
Usually this resulted in parsing error messages. Fix the problem by
rewriting the offending code in a less hacky form.
Diffstat (limited to 'bstr.h')
-rw-r--r-- | bstr.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -38,8 +38,10 @@ int bstrcmp(struct bstr str1, struct bstr str2); int bstrcasecmp(struct bstr str1, struct bstr str2); int bstrchr(struct bstr str, int c); int bstrrchr(struct bstr str, int c); + 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, char *sep, struct bstr *rest); struct bstr bstr_splice(struct bstr str, int start, int end); |