From 233b1ac80a280700dcb82872fde206ccf480c157 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sat, 26 Jan 2013 22:36:18 +0000 Subject: [PATCH] =?UTF-8?q?[BUG=5FFIXED]=20(Author:=20Pekka=20P=C3=B6yry)?= =?UTF-8?q?=20Empty=20document=20cannot=20be=20saved=20when=20using=20spec?= =?UTF-8?q?ial=20encoding.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1010 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index dff25ed55..9f6619162 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -674,6 +674,8 @@ bool FileManager::saveBuffer(BufferID id, const TCHAR * filename, bool isCopy, g grabSize -= incompleteMultibyteChar; items_written = UnicodeConvertor.fwrite(newData, newDataLen); } + if (lengthDoc == 0) + items_written = 1; } UnicodeConvertor.fclose(); @@ -682,7 +684,7 @@ bool FileManager::saveBuffer(BufferID id, const TCHAR * filename, bool isCopy, g if(items_written != 1) { 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; }