mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
text I/O: always treat newlines as EOL regardless of detected EOL style
Problematic were files for which DOS-style EOLs were detected (carriage return followed by newline, \r\n) but which had some lines terminated solely by a newline (\n). In such a case the EOL was only detected upon seeing the next \r\n, and the value returned from the `getline()` function would return something that everyone would judge to be multiple lines of text. Fixes #2594.
This commit is contained in:
parent
5d18a7d804
commit
190827ee5a
3
NEWS.md
3
NEWS.md
@ -12,6 +12,9 @@
|
||||
files even if the `clip_codec_identifier` playlist item field is not set to
|
||||
`M2TS` in the MPLS file. Fixes #2601.
|
||||
* all: fixed the spelling of the H.264 & H.265 codec names.
|
||||
* mkvmerge: fixed handling of text files that use both DOS-style and
|
||||
Unix-style line endings resulting in problems such as text subtitle files
|
||||
not being parsed correctly. Fixes #2594.
|
||||
|
||||
|
||||
# Version 35.0.0 "All The Love In The World" 2019-06-22
|
||||
|
@ -246,7 +246,7 @@ mm_text_io_c::getline(boost::optional<std::size_t> max_chars) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((1 == len) && (utf8char[0] == '\n') && (!p->uses_carriage_returns || previous_was_carriage_return))
|
||||
if ((1 == len) && (utf8char[0] == '\n'))
|
||||
return s;
|
||||
|
||||
if (previous_was_carriage_return) {
|
||||
|
@ -518,3 +518,4 @@ T_669ssa_ass_zero_duration:1bbca62bfcc25b7480e8bbfb228f510e-c34beca52c9bf3eac07c
|
||||
T_670h265_interlaced:720x480+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080:passed:20190126-134743:0.040331695
|
||||
T_671emojis:063f1c31e5ba1046edd225f387eb0d81-true:passed:20190312-202232:0.016691955
|
||||
T_672codec_name:8548fda1649436cf8036dfdb32be369c-true:passed:20190617-195042:0.027569471
|
||||
T_673srt_different_eol_styles:c1932566efe7110914a21720fc1ac69f:passed:20190810-160539:0.070217493
|
||||
|
5
tests/test-673srt_different_eol_styles.rb
Executable file
5
tests/test-673srt_different_eol_styles.rb
Executable file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/ruby -w
|
||||
|
||||
# T_673srt_different_eol_styles
|
||||
describe "mkvmerge / SRT text subtitles with both DOS & Unix style line endings"
|
||||
test_merge "data/subtitles/srt/different_eol_styles.srt", :exit_code => :warning
|
Loading…
Reference in New Issue
Block a user