Skip to content

Commit f7b1c63

Browse files
Merge pull request #611 from mxaddict/windows-error-log
Fixed error.log loading in Debug Window (Windows)
2 parents e688c6e + cb8dee1 commit f7b1c63

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎src/qt/rpcconsole.cpp‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,17 @@ void RPCConsole::errorLogInitPos()
345345
// We need to move the file pos back by ERROR_LOG_INITIAL_COUNT lines
346346
QString ch;
347347
int lineCount = 0;
348+
int lastPos = 0;
348349
while ((lineCount < ERROR_LOG_INITIAL_COUNT) && (errorLogFile->pos() > 0))
349350
{
351+
// Save the last position before the read
352+
lastPos = errorLogFile->pos();
353+
350354
// Load the current character
351355
ch = errorLogFile->read(1);
352356

353-
// Move pos back by 2 spaces
354-
errorLogFile->seek(errorLogFile->pos() - 2);
357+
// Move pos back by 1 spaces
358+
errorLogFile->seek(lastPos - 1);
355359

356360
// Check if we have a newline
357361
if (ch == "\n")

0 commit comments

Comments
 (0)