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); }