mirror of
https://github.com/odrling/Aegisub
synced 2025-04-11 22:56:02 +02:00
Allow garbage after the timestamp in SRT files. Updates #1614.
This commit is contained in:
parent
7c7cfc79e6
commit
135133e4c2
@ -384,13 +384,13 @@ void SRTSubtitleFormat::ReadFile(AssFile *target, agi::fs::path const& filename,
|
||||
state = STATE_TIMESTAMP;
|
||||
break;
|
||||
}
|
||||
if (regex_match(text_line, timestamp_match, timestamp_regex))
|
||||
if (regex_search(text_line, timestamp_match, timestamp_regex))
|
||||
goto found_timestamps;
|
||||
|
||||
throw SRTParseError(str(boost::format("Parsing SRT: Expected subtitle index at line %d") % line_num), 0);
|
||||
|
||||
case STATE_TIMESTAMP:
|
||||
if (!regex_match(text_line, timestamp_match, timestamp_regex))
|
||||
if (!regex_search(text_line, timestamp_match, timestamp_regex))
|
||||
throw SRTParseError(str(boost::format("Parsing SRT: Expected timestamp pair at line %d") % line_num), 0);
|
||||
found_timestamps:
|
||||
if (line) {
|
||||
@ -443,7 +443,7 @@ found_timestamps:
|
||||
state = STATE_TIMESTAMP;
|
||||
break;
|
||||
}
|
||||
if (regex_match(text_line, timestamp_match, timestamp_regex))
|
||||
if (regex_search(text_line, timestamp_match, timestamp_regex))
|
||||
goto found_timestamps;
|
||||
|
||||
// assume it's a continuation of the subtitle text
|
||||
|
Loading…
x
Reference in New Issue
Block a user