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:
parent
3f78121948
commit
ea04082549
@ -98,21 +98,33 @@ bool aga_unzip(const char* zipfile, const char* destdir)
|
|||||||
const unsigned int files = aga_ziplist(zipfile, aFiles);
|
const unsigned int files = aga_ziplist(zipfile, aFiles);
|
||||||
for (unsigned int f = 0; f < files; f++)
|
for (unsigned int f = 0; f < files; f++)
|
||||||
{
|
{
|
||||||
const wxString& strFileName = aFiles[f];
|
const wxString& strFileName = aFiles[f];
|
||||||
wxZipInputStream fin(zipfile, strFileName);
|
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;
|
wxString strOutFile = destdir;
|
||||||
if (!wxEndsWithPathSeparator(strOutFile))
|
if (!wxEndsWithPathSeparator(strOutFile))
|
||||||
strOutFile += wxFILE_SEP_PATH;
|
strOutFile += wxFILE_SEP_PATH;
|
||||||
strOutFile += strFileName;
|
strOutFile += strFileName;
|
||||||
|
|
||||||
wxString strPath;
|
wxString strPath;
|
||||||
::wxSplitPath(strOutFile, &strPath, NULL, NULL);
|
::wxSplitPath(strOutFile, &strPath, NULL, NULL);
|
||||||
if (!::wxDirExists(strPath))
|
if (!::wxDirExists(strPath))
|
||||||
::wxMkdir(strPath);
|
::wxMkdir(strPath);
|
||||||
|
|
||||||
wxFileOutputStream fout(strOutFile);
|
wxFileOutputStream fout(strOutFile);
|
||||||
fout.Write(fin);
|
fout.Write(fin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return files > 0;
|
return files > 0;
|
||||||
}
|
}
|
||||||
|
@ -2474,7 +2474,7 @@ BOOLEAN xvt_fsys_build_pathname(char *mbs, const char *volname, const char *dirn
|
|||||||
strcpy(mbs, dirname);
|
strcpy(mbs, dirname);
|
||||||
if (leafroot && *leafroot)
|
if (leafroot && *leafroot)
|
||||||
{
|
{
|
||||||
if (*leafroot != '/' && *leafroot != '\\')
|
if (!wxEndsWithPathSeparator(mbs) && !wxIsPathSeparator(*leafroot))
|
||||||
strcat(mbs, "/");
|
strcat(mbs, "/");
|
||||||
strcat(mbs, leafroot);
|
strcat(mbs, leafroot);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user