Skip to content
Permalink
Browse files

Fix: don't ignore the very last line when no LF after that

  • Loading branch information...
pinterf committed May 9, 2018
1 parent c08022c commit 569cc5aa2f9c658de6ea52ad8c2c7414fc5072f0
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/subtitles/STS.cpp
@@ -553,7 +553,12 @@ static bool OpenSubRipper(CTextFile* file, CSimpleTextSubtitle& ret, int CharSet

bool fFoundEmpty = false;

while (file->ReadString(tmp)) {
while (true) {
// PF: don't ignore the very last line when there is no LF after that
bool fEOF = !file->ReadString(tmp);
if (fEOF && tmp.IsEmpty())
break;

FastTrim(tmp);
if (tmp.IsEmpty()) {
fFoundEmpty = true;
@@ -567,6 +572,9 @@ static bool OpenSubRipper(CTextFile* file, CSimpleTextSubtitle& ret, int CharSet
}

str += tmp + '\n';

if (fEOF)
break;
}

ret.Add(

0 comments on commit 569cc5a

Please sign in to comment.
You can’t perform that action at this time.