]> git.saurik.com Git - wxWidgets.git/commitdiff
don't give error when reading empty file in Unicode build
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 Mar 2006 14:00:31 +0000 (14:00 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 Mar 2006 14:00:31 +0000 (14:00 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/textfile.cpp

index c48a48d2aba1642f6b8bbe31048af2afb2e8fd62..1ba27db9f15da8369f29ce952fe81acef960e544 100644 (file)
@@ -137,8 +137,10 @@ bool wxTextFile::OnRead(wxMBConv& conv)
     }
 
     const wxString str(buf, conv);
+
+    // this doesn't risk to happen in ANSI build
 #if wxUSE_UNICODE
-    if ( str.empty() )
+    if ( bufSize > 4 && str.empty() )
     {
         wxLogError(_("Failed to convert file contents to Unicode."));
         return false;