From bdfdece245b5aa863b4c57996c38b5638d7797d0 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 9 Apr 2011 05:14:55 +0300 Subject: subs: move vobsub loading logic down to find_subfiles.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- bstr.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bstr.c') 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)) { -- cgit v1.2.3