summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-05-23 23:13:54 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-23 23:13:54 +0100
commitb082fb6a16e8f6b0b81677debb5c8d22c585421a (patch)
treed1accc989f4970fe7071438bbd37c9313b06c19d
parent7910e19cf145cbdc99fbf1015add6f8eb792e160 (diff)
Add another test and allow spaces at the end of time/position lines.
-rw-r--r--src/subrip_reader.cc4
-rw-r--r--test/subrip_reader_test.cc1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/subrip_reader.cc b/src/subrip_reader.cc
index a82862c..ea693db 100644
--- a/src/subrip_reader.cc
+++ b/src/subrip_reader.cc
@@ -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");
diff --git a/test/subrip_reader_test.cc b/test/subrip_reader_test.cc
index a20cc07..cb72e28 100644
--- a/test/subrip_reader_test.cc
+++ b/test/subrip_reader_test.cc
@@ -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");
}