* 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 -
This commit is contained in:
marco 2010-03-21 10:28:29 +00:00
parent 49fc4795e3
commit 0f9f3600c5
2 changed files with 10 additions and 2 deletions

View File

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

View File

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