Fix a crash issue due to opening an empty .NFO file
There was an infinite recursion for such empty files, when the default setting for new files was UTF8. Fixes #11820, close #11824
This commit is contained in:
parent
2258274780
commit
9d69db9b15
|
@ -1601,7 +1601,7 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const TCHAR * fil
|
||||||
fileFormat._eolFormat = ndds._format;
|
fileFormat._eolFormat = ndds._format;
|
||||||
|
|
||||||
//for empty files, if the default for new files is UTF8, and "Apply to opened ANSI files" is set, apply it
|
//for empty files, if the default for new files is UTF8, and "Apply to opened ANSI files" is set, apply it
|
||||||
if (fileSize == 0)
|
if ((fileSize == 0) && (fileFormat._encoding < 1))
|
||||||
{
|
{
|
||||||
if (ndds._unicodeMode == uniCookie && ndds._openAnsiAsUtf8)
|
if (ndds._unicodeMode == uniCookie && ndds._openAnsiAsUtf8)
|
||||||
fileFormat._encoding = SC_CP_UTF8;
|
fileFormat._encoding = SC_CP_UTF8;
|
||||||
|
|
Loading…
Reference in New Issue