Fix file reading failure (network problem) not detected issue
The current bug: the unconnected network or USB drive while loading a file from it is not detected. As a result Notepad++ opens an empty or uncomplete document. This commit fix it by not opening anything and showing error box, if file reading fails. Fix #3381, close #8267
This commit is contained in:
parent
4003d6d923
commit
a42c1674e9
|
@ -1351,6 +1351,11 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data,
|
|||
do
|
||||
{
|
||||
lenFile = fread(data+incompleteMultibyteChar, 1, blockSize-incompleteMultibyteChar, fp) + incompleteMultibyteChar;
|
||||
if (ferror(fp) != 0)
|
||||
{
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
if (lenFile == 0) break;
|
||||
|
||||
if (isFirstTime)
|
||||
|
|
Loading…
Reference in New Issue