From 0f9f3600c5e50341ef76357d990efdb1ef6827c1 Mon Sep 17 00:00:00 2001 From: marco Date: Sun, 21 Mar 2010 10:28:29 +0000 Subject: [PATCH] * Disable parts of commit 13378 for windows, since it blocks extracting zips with Unix lineseparators (like Open Office files, even when generated on Windows) * Minor tweak to demo git-svn-id: trunk@15025 - --- packages/paszlib/examples/extractodt.pas | 2 +- packages/paszlib/src/zipper.pp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/paszlib/examples/extractodt.pas b/packages/paszlib/examples/extractodt.pas index f1f684a629..774b38bc0c 100755 --- a/packages/paszlib/examples/extractodt.pas +++ b/packages/paszlib/examples/extractodt.pas @@ -20,7 +20,7 @@ begin FileName:=paramstr(1); if not fileexists(FileName) then Usage; - edir:=extractfilename(filename)+'extractiondir'; + edir:=extractfilename(filename)+'.extractiondir'; mkdir(edir); unzipper:=TUnzipper.create; unzipper.FileName:=FileName; diff --git a/packages/paszlib/src/zipper.pp b/packages/paszlib/src/zipper.pp index 1e2f5195d7..1e37a2041e 100644 --- a/packages/paszlib/src/zipper.pp +++ b/packages/paszlib/src/zipper.pp @@ -1561,9 +1561,15 @@ Begin for Windows compatibility: it allows both '/' and '\' as directory separator. We don't want that behaviour here, since 'abc\' is a valid file name under Unix. + + (mantis 15836) On the other hand, many archives on + windows have '/' as pathseparator, even Windows + generated .odt files. So we disable this for windows. } OldDirectorySeparators:=AllowDirectorySeparators; + {$ifndef Windows} AllowDirectorySeparators:=[DirectorySeparator]; + {$endif} Path:=ExtractFilePath(OutFileName); OutStream:=Nil; If Assigned(FOnCreateStream) then @@ -1576,10 +1582,12 @@ Begin AllowDirectorySeparators:=OldDirectorySeparators; OutStream:=TFileStream.Create(OutFileName,fmCreate); end; - + + AllowDirectorySeparators:=OldDirectorySeparators; Result:=True; If Assigned(FOnStartFile) then FOnStartFile(Self,OutFileName); + End;