From a46904f1b9ecd312e2eb9ea0f5835ea8adf06ac8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 3 Sep 2008 17:42:46 +0000 Subject: [PATCH] 2008-09-03 19:41 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/hbziparc/hbziparc.prg ! RTE fixed when not specifying some optional params. ! Fixed to parse the right array, and thus not exluding all filenames to be zipped. ; Disclaimer: I'm not a user of these functions, and I've admittedly not tested them besides tests/unzipa.prg and tests/zipa.prg (which are pretty basic cases), so bumps are expected. If you find some bugs, please try to provide patches to fix them. Thanks. --- harbour/ChangeLog | 11 +++++++++++ harbour/contrib/hbziparc/hbziparc.prg | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8399afd464..886eacd165 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,17 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-09-03 19:41 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * contrib/hbziparc/hbziparc.prg + ! RTE fixed when not specifying some optional params. + ! Fixed to parse the right array, and thus not exluding + all filenames to be zipped. + ; Disclaimer: I'm not a user of these functions, and + I've admittedly not tested them besides tests/unzipa.prg + and tests/zipa.prg (which are pretty basic cases), so + bumps are expected. If you find some bugs, please try + to provide patches to fix them. Thanks. + 2008-09-03 16:36 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/hbziparc/make_b32.bat * contrib/hbziparc/make_vc.bat diff --git a/harbour/contrib/hbziparc/hbziparc.prg b/harbour/contrib/hbziparc/hbziparc.prg index a85c38a346..c377cb7b15 100644 --- a/harbour/contrib/hbziparc/hbziparc.prg +++ b/harbour/contrib/hbziparc/hbziparc.prg @@ -760,6 +760,8 @@ FUNCTION hb_ZipFile( cFileName,; IF !Empty( hZip := hb_ZipOpen( cFileName ) ) + DEFAULT acFiles TO {} + DEFAULT acExclude TO {} DEFAULT lWithPath TO .F. DEFAULT lWithDrive TO .F. @@ -775,7 +777,7 @@ FUNCTION hb_ZipFile( cFileName,; /* NOTE: Try not to add the .zip file to itself. */ hb_FNameSplit( cFileName, NIL, @cName, @cExt ) aExclFile := { hb_FNameMerge( NIL, cName, cExt ) } - FOR EACH cFN IN acFiles + FOR EACH cFN IN acExclude IF "?" $ cFN .OR. "*" $ cFN tmp := Directory( cFN ) FOR EACH aFile IN tmp