From: Francesco Montorsi Date: Sun, 25 Jul 2010 11:26:04 +0000 (+0000) Subject: do not add files in wxDebugReport::AddFile if copy failed X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c02f03d563e895258dcac98a2ade423a1acbf7f9 do not add files in wxDebugReport::AddFile if copy failed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/interface/wx/debugrpt.h b/interface/wx/debugrpt.h index dcae685d08..65aa1a5185 100644 --- a/interface/wx/debugrpt.h +++ b/interface/wx/debugrpt.h @@ -220,9 +220,11 @@ public: /** Add another file to the report. If @a filename is an absolute path, it is copied to a file in the debug report directory with the same name. - Otherwise the file should already exist in this directory - @a description only exists to be displayed to the user in the report - summary shown by wxDebugReportPreview. + Otherwise the file will be searched in the temporary directory returned + by GetDirectory(). + + The argument @a description only exists to be displayed to the user in + the report summary shown by wxDebugReportPreview. @see GetDirectory(), AddText() */ diff --git a/src/common/debugrpt.cpp b/src/common/debugrpt.cpp index 6f0327e59e..a903051fcf 100644 --- a/src/common/debugrpt.cpp +++ b/src/common/debugrpt.cpp @@ -268,8 +268,10 @@ wxDebugReport::AddFile(const wxString& filename, const wxString& description) // we need to copy the file to the debug report directory: give it the // same name there name = fn.GetFullName(); - wxCopyFile(fn.GetFullPath(), - wxFileName(GetDirectory(), name).GetFullPath()); + + if (!wxCopyFile(fn.GetFullPath(), + wxFileName(GetDirectory(), name).GetFullPath())) + return; } else // file relative to the report directory {