Skip to content

Commit 057a12e

Browse files
committed
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 CobaltFusion#352. Now FileReader always splits on newlines regardless of what the user selected for "Auto Newline" option from the menu. Fixes CobaltFusion#352.
1 parent ca8a8e1 commit 057a12e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

DebugView++Lib/FileReader.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ void FileReader::Abort()
4646
}
4747
}
4848

49+
bool FileReader::GetAutoNewLine() const
50+
{
51+
return true;
52+
}
53+
4954
void FileReader::PollThread()
5055
{
5156
// FILE_NOTIFY_CHANGE_SIZE is broken on windows vista and above in that it does not

include/DebugView++Lib/FileReader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class FileReader : public LogSource
3232
HANDLE GetHandle() const override;
3333
void Notify() override;
3434
void PreProcess(Line& line) const override;
35+
virtual bool GetAutoNewLine() const override;
3536

3637
protected:
3738
virtual void AddLine(const std::string& line);

0 commit comments

Comments
 (0)