From 44327ff375205d04dd7f71560b454f3ec283c233 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 31 Mar 2006 14:00:31 +0000 Subject: [PATCH 1/1] don't give error when reading empty file in Unicode build git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/textfile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/textfile.cpp b/src/common/textfile.cpp index c48a48d2ab..1ba27db9f1 100644 --- a/src/common/textfile.cpp +++ b/src/common/textfile.cpp @@ -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; -- 2.47.2