From bb0678a0da9336b73e75e150119a2646457ce5a2 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 11 Sep 2012 18:47:35 +0000 Subject: [PATCH] [BUG_FiXED] Fix a regression of wrong behaviour while save an empty file. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@957 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index db58e20d..1710bc1b 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -640,6 +640,8 @@ bool FileManager::saveBuffer(BufferID id, const TCHAR * filename, bool isCopy, g if (encoding == -1) //no special encoding; can be handled directly by Utf8_16_Write { items_written = UnicodeConvertor.fwrite(buf, lengthDoc); + if (lengthDoc == 0) + items_written = 1; } else {