diff options
Diffstat (limited to 'rbutil/rbutil.cpp')
-rw-r--r-- | rbutil/rbutil.cpp | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/rbutil/rbutil.cpp b/rbutil/rbutil.cpp index b7a1fa6a73..9ffe9a6c58 100644 --- a/rbutil/rbutil.cpp +++ b/rbutil/rbutil.cpp | |||
@@ -21,28 +21,29 @@ | |||
21 | #include "rbutil.h" | 21 | #include "rbutil.h" |
22 | #include "installlog.h" | 22 | #include "installlog.h" |
23 | 23 | ||
24 | |||
24 | // This class allows us to return directories as well as files to | 25 | // This class allows us to return directories as well as files to |
25 | // wxDir::Traverse | 26 | // wxDir::Traverse |
26 | class wxDirTraverserIncludeDirs : public wxDirTraverser | 27 | class wxDirTraverserIncludeDirs : public wxDirTraverser |
27 | { | 28 | { |
28 | public: | 29 | public: |
29 | wxDirTraverserIncludeDirs(wxArrayString& files) : m_files(files) { } | 30 | wxDirTraverserIncludeDirs(wxArrayString& files) : m_files(files) { } |
30 | 31 | ||
31 | virtual wxDirTraverseResult OnFile(const wxString& filename) | 32 | virtual wxDirTraverseResult OnFile(const wxString& filename) |
32 | { | 33 | { |
33 | m_files.Add(filename); | 34 | m_files.Add(filename); |
34 | return wxDIR_CONTINUE; | 35 | return wxDIR_CONTINUE; |
35 | } | 36 | } |
36 | 37 | ||
37 | virtual wxDirTraverseResult OnDir(const wxString& dirname) | 38 | virtual wxDirTraverseResult OnDir(const wxString& dirname) |
38 | { | 39 | { |
39 | m_files.Add(dirname); | 40 | m_files.Add(dirname); |
40 | return wxDIR_CONTINUE; | 41 | return wxDIR_CONTINUE; |
41 | } | 42 | } |
42 | 43 | ||
43 | private: | 44 | private: |
44 | wxArrayString& m_files; | 45 | wxArrayString& m_files; |
45 | }; | 46 | }; |
46 | 47 | ||
47 | wxDEFINE_SCOPED_PTR_TYPE(wxZipEntry); | 48 | wxDEFINE_SCOPED_PTR_TYPE(wxZipEntry); |
48 | 49 | ||
@@ -272,18 +273,15 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall) | |||
272 | in_str.Printf(wxT("%s" PATH_SEP "%s"), destdir.c_str(), name.c_str()); | 273 | in_str.Printf(wxT("%s" PATH_SEP "%s"), destdir.c_str(), name.c_str()); |
273 | 274 | ||
274 | if (entry->IsDir() ) { | 275 | if (entry->IsDir() ) { |
275 | wxDir* dirname = new wxDir(in_str); | 276 | if (!wxDirExists(in_str) ) { |
276 | if (! dirname->Exists(in_str) ) { | ||
277 | if (! wxMkdir(in_str, 0777) ) { | 277 | if (! wxMkdir(in_str, 0777) ) { |
278 | buf.Printf(_("Unable to create directory %s"), | 278 | buf.Printf(_("Unable to create directory %s"), |
279 | in_str.c_str() ); | 279 | in_str.c_str() ); |
280 | errnum = 100; | 280 | errnum = 100; |
281 | delete dirname; | ||
282 | break; | 281 | break; |
283 | } | 282 | } |
284 | } | 283 | } |
285 | log->WriteFile(name, true); // Directory | 284 | log->WriteFile(name, true); // Directory |
286 | delete dirname; | ||
287 | continue; | 285 | continue; |
288 | } | 286 | } |
289 | 287 | ||