Add another test and allow spaces at the end of time/position lines.
authorCarl Hetherington <cth@carlh.net>
Mon, 23 May 2016 22:13:54 +0000 (23:13 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 23 May 2016 22:13:54 +0000 (23:13 +0100)
src/subrip_reader.cc
test/subrip_reader_test.cc

index a82862cb5bc060000773d3b1edaa172976086bd3..ea693db5896aa91779e1e03794ec748f1daf263f 100644 (file)
@@ -113,6 +113,10 @@ SubripReader::read (function<optional<string> ()> get_line)
                case METADATA:
                {
                        vector<string> p;
+
+                       /* Further trim this line, removing spaces from the end */
+                       trim_right_if (*line, boost::is_any_of (" "));
+
                        boost::algorithm::split (p, *line, boost::algorithm::is_any_of (" "));
                        if (p.size() != 3 && p.size() != 7) {
                                throw SubripError (*line, "a time/position line");
index a20cc07bccb48348bfb93df68f977c7d535a1514..cb72e28401aaca48b434496e88722f349b2dc65f 100644 (file)
@@ -369,4 +369,5 @@ BOOST_AUTO_TEST_CASE (subrip_read_test)
        test ("sintel_en.srt");
        test ("sintel_fr.srt");
        test ("Fight.Club.1999.720p.BRRip.x264-x0r.srt");
+       test ("EU13.srt");
 }