diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f69125f21b..54456a9ee5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2011-10-23 15:53 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbziparc/ziparc.prg + ! HB_UNZIPFILE(): fixed counting bytes read. Please test. + 2011-10-22 16:22 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/vm/fm.c ! do not enable by default DLMALLOC in WinCE builds. diff --git a/harbour/contrib/hbziparc/ziparc.prg b/harbour/contrib/hbziparc/ziparc.prg index ce444f2c1b..327f92f038 100644 --- a/harbour/contrib/hbziparc/ziparc.prg +++ b/harbour/contrib/hbziparc/ziparc.prg @@ -451,7 +451,6 @@ FUNCTION hb_UnzipFile( cFileName, bUpdate, lWithPath, cPassword, cPath, acFiles, cPath := hb_DirSepAdd( cPath ) - nRead := 0 nPos := 0 nErr := hb_UnzipFileFirst( hUnzip ) DO WHILE nErr == 0 @@ -471,6 +470,8 @@ FUNCTION hb_UnzipFile( cFileName, bUpdate, lWithPath, cPassword, cPath, acFiles, IF hb_UnzipFileOpen( hUnzip, cPassword ) != UNZ_OK EXIT ENDIF + + nRead := 0 DO WHILE ( nLen := hb_unZipFileRead( hUnzip, @cBuffer, Len( cBuffer ) ) ) > 0 IF hb_isBlock( bProgress ) nRead += nLen @@ -478,9 +479,12 @@ FUNCTION hb_UnzipFile( cFileName, bUpdate, lWithPath, cPassword, cPath, acFiles, ENDIF FWrite( hHandle, cBuffer, nLen ) ENDDO + hb_UnzipFileClose( hUnzip ) FClose( hHandle ) + hb_FSetDateTime( cPath + cZipName, dDate, cTime ) + IF hb_isBlock( bUpdate ) Eval( bUpdate, cZipName, nPos ) ENDIF