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
This commit is contained in:
guy 2003-10-03 11:01:47 +00:00
parent 3f78121948
commit ea04082549
2 changed files with 25 additions and 13 deletions

View File

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

View File

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