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 a93dcc531c
)
This commit is contained in:
@@ -1092,7 +1092,11 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
|
|||||||
return false;
|
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__)
|
#if defined(__WXMAC__) || defined(__WXCOCOA__)
|
||||||
// copy the resource fork of the file too if it's present
|
// copy the resource fork of the file too if it's present
|
||||||
|
Reference in New Issue
Block a user