diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-04-09 05:14:55 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-04-20 04:22:52 +0300 |
commit | bdfdece245b5aa863b4c57996c38b5638d7797d0 (patch) | |
tree | 3036399e13ea08cc44019d1e7208295f47226865 /bstr.c | |
parent | 7221e28fe3d743aaf6357bb0838e762781644f0d (diff) | |
download | mpv-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.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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)) { |