From ea04082549ab9bfc84625e5e7f6dcfacf5aedd9b Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 3 Oct 2003 11:01:47 +0000 Subject: [PATCH] Patch level : 2.0 588 Files correlati : xvaga.dll Ricompilazione Demo : [ ] Commento : Corretto supporto per file zippati contenenti sotto-cartelle. Serve per gestire i file di help in html git-svn-id: svn://10.65.10.50/trunk@11463 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- xvaga/agasys.cpp | 36 ++++++++++++++++++++++++------------ xvaga/xvaga.cpp | 2 +- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/xvaga/agasys.cpp b/xvaga/agasys.cpp index b087e3f74..c98a0cbb9 100755 --- a/xvaga/agasys.cpp +++ b/xvaga/agasys.cpp @@ -98,21 +98,33 @@ bool aga_unzip(const char* zipfile, const char* destdir) const unsigned int files = aga_ziplist(zipfile, aFiles); for (unsigned int f = 0; f < files; f++) { - const wxString& strFileName = aFiles[f]; - wxZipInputStream fin(zipfile, strFileName); + const wxString& strFileName = aFiles[f]; + if (wxEndsWithPathSeparator(strFileName)) // Is dir name + { + wxString strOutDir = destdir; + if (!wxEndsWithPathSeparator(strOutDir)) + strOutDir += wxFILE_SEP_PATH; + strOutDir += strFileName; + if (!::wxDirExists(strOutDir)) + ::wxMkdir(strOutDir); + } + else + { + wxZipInputStream fin(zipfile, strFileName); - wxString strOutFile = destdir; - if (!wxEndsWithPathSeparator(strOutFile)) - strOutFile += wxFILE_SEP_PATH; - strOutFile += strFileName; + wxString strOutFile = destdir; + if (!wxEndsWithPathSeparator(strOutFile)) + strOutFile += wxFILE_SEP_PATH; + strOutFile += strFileName; - wxString strPath; - ::wxSplitPath(strOutFile, &strPath, NULL, NULL); - if (!::wxDirExists(strPath)) - ::wxMkdir(strPath); + wxString strPath; + ::wxSplitPath(strOutFile, &strPath, NULL, NULL); + if (!::wxDirExists(strPath)) + ::wxMkdir(strPath); - wxFileOutputStream fout(strOutFile); - fout.Write(fin); + wxFileOutputStream fout(strOutFile); + fout.Write(fin); + } } return files > 0; } diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index d0998686b..78b8f8dbc 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -2474,7 +2474,7 @@ BOOLEAN xvt_fsys_build_pathname(char *mbs, const char *volname, const char *dirn strcpy(mbs, dirname); if (leafroot && *leafroot) { - if (*leafroot != '/' && *leafroot != '\\') + if (!wxEndsWithPathSeparator(mbs) && !wxIsPathSeparator(*leafroot)) strcat(mbs, "/"); strcat(mbs, leafroot); }