From e1e94820050039b02da6e0c33297b73ec51e4dd7 Mon Sep 17 00:00:00 2001 From: samurajj Date: Mon, 22 Aug 2016 14:17:43 +0200 Subject: [PATCH] Fix error reporting for wxCopyFile() under Unix Check if copying file actually succeeded, any IO errors that could happen in it were previously just completely ignored. See #17638. (cherry picked from commit a93dcc531c94897b13944c779b185b42570511ac) --- src/common/filefn.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index f563a1a5ea..f6e368ee32 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1092,7 +1092,11 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite) return false; } - wxDoCopyFile(fileIn, fbuf, file2, overwrite); + if ( !wxDoCopyFile(fileIn, fbuf, file2, overwrite) ) + { + wxLogError(_("Error copying the file '%s' to '%s'."), file1, file2); + return false; + } #if defined(__WXMAC__) || defined(__WXCOCOA__) // copy the resource fork of the file too if it's present