Skip to content

Commit 779a0e3

Browse files
IshmaeelJan Wilmans
authored andcommitted
Disregard "Auto Newline" user setting and always assume auto newline in FileReader
This may not be the proper place to fix this but it works nicely at least as a temporary measure. The alternative is a potential DoS when trying to open large files as discussed in #352. Now FileReader always splits on newlines regardless of what the user selected for "Auto Newline" option from the menu. Fixes #352.
1 parent d3743e5 commit 779a0e3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

application/DebugViewppLib/FileReader.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ void FileReader::Abort()
4343
}
4444
}
4545

46+
bool FileReader::GetAutoNewLine() const
47+
{
48+
return true;
49+
}
50+
4651
void FileReader::PollThread()
4752
{
4853
// FILE_NOTIFY_CHANGE_SIZE is broken on windows vista and above in that it does not

application/include/DebugViewppLib/FileReader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class FileReader : public LogSource
3030
HANDLE GetHandle() const override;
3131
void Notify() override;
3232
void PreProcess(Line& line) const override;
33+
virtual bool GetAutoNewLine() const override;
3334

3435
protected:
3536
virtual void AddLine(const std::string& line);

0 commit comments

Comments
 (0)