summaryrefslogtreecommitdiffstats
path: root/bstr.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-04-09 05:14:55 +0300
committerUoti Urpala <uau@mplayer2.org>2011-04-20 04:22:52 +0300
commitbdfdece245b5aa863b4c57996c38b5638d7797d0 (patch)
tree3036399e13ea08cc44019d1e7208295f47226865 /bstr.c
parent7221e28fe3d743aaf6357bb0838e762781644f0d (diff)
downloadmpv-bdfdece245b5aa863b4c57996c38b5638d7797d0.tar.bz2
mpv-bdfdece245b5aa863b4c57996c38b5638d7797d0.tar.xz
subs: move vobsub loading logic down to find_subfiles.c
Analogously to the previous commit, move path handling logic for loading external vobsub files from mplayer.c to find_subfiles.c. Based on a commit from Clément Bœsch but fixed and simplified.
Diffstat (limited to 'bstr.c')
-rw-r--r--bstr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bstr.c b/bstr.c
index d86b488912..f4d3bdef42 100644
--- a/bstr.c
+++ b/bstr.c
@@ -62,6 +62,14 @@ int bstrchr(struct bstr str, int c)
return -1;
}
+int bstrrchr(struct bstr str, int c)
+{
+ for (int i = str.len - 1; i >= 0; i--)
+ if (str.start[i] == c)
+ return i;
+ return -1;
+}
+
struct bstr bstr_strip(struct bstr str)
{
while (str.len && isspace(*str.start)) {