From 0ce219566a01b7a507a5d487704a53dd66df5e49 Mon Sep 17 00:00:00 2001 From: milipili Date: Sat, 30 May 2015 02:26:55 +0200 Subject: [PATCH] ScitillaComponent: Buffer: fixed an uninitialized variable in ctor The non-default constructor of the class Buffer calls the inner method `checkFileState()`, using the private variable `_currentStatus` to determine whether some checks on the file attached to the buffer are required or not. However this variable is properly initialized _after_. --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index f6f24293..7667a5c0 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -60,10 +60,11 @@ Buffer::Buffer(FileManager * pManager, BufferID id, Document doc, DocFileStatus _userLangExt = TEXT(""); _fullPathName = TEXT(""); _fileName = NULL; + _currentStatus = type; + setFileName(fileName, ndds._lang); updateTimeStamp(); checkFileState(); - _currentStatus = type; _isDirty = false; _needLexer = false; //new buffers do not need lexing, Scintilla takes care of that