[BUG_FIXED] (Author: Pekka Pöyry) Empty document cannot be saved when using special encoding.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1010 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2013-01-26 22:36:18 +00:00
parent ffdebe56ed
commit 233b1ac80a

View File

@ -674,6 +674,8 @@ bool FileManager::saveBuffer(BufferID id, const TCHAR * filename, bool isCopy, g
grabSize -= incompleteMultibyteChar; grabSize -= incompleteMultibyteChar;
items_written = UnicodeConvertor.fwrite(newData, newDataLen); items_written = UnicodeConvertor.fwrite(newData, newDataLen);
} }
if (lengthDoc == 0)
items_written = 1;
} }
UnicodeConvertor.fclose(); UnicodeConvertor.fclose();
@ -682,7 +684,7 @@ bool FileManager::saveBuffer(BufferID id, const TCHAR * filename, bool isCopy, g
if(items_written != 1) if(items_written != 1)
{ {
if(error_msg != NULL) if(error_msg != NULL)
*error_msg = TEXT("Not enough space on disk to save file."); *error_msg = TEXT("Failed to save file.\nNot enough space on disk to save file?");
return false; return false;
} }