mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-09 10:26:02 +02:00
* 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:
parent
49fc4795e3
commit
0f9f3600c5
@ -20,7 +20,7 @@ begin
|
|||||||
FileName:=paramstr(1);
|
FileName:=paramstr(1);
|
||||||
if not fileexists(FileName) then
|
if not fileexists(FileName) then
|
||||||
Usage;
|
Usage;
|
||||||
edir:=extractfilename(filename)+'extractiondir';
|
edir:=extractfilename(filename)+'.extractiondir';
|
||||||
mkdir(edir);
|
mkdir(edir);
|
||||||
unzipper:=TUnzipper.create;
|
unzipper:=TUnzipper.create;
|
||||||
unzipper.FileName:=FileName;
|
unzipper.FileName:=FileName;
|
||||||
|
@ -1561,9 +1561,15 @@ Begin
|
|||||||
for Windows compatibility: it allows both '/' and '\'
|
for Windows compatibility: it allows both '/' and '\'
|
||||||
as directory separator. We don't want that behaviour
|
as directory separator. We don't want that behaviour
|
||||||
here, since 'abc\' is a valid file name under Unix.
|
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;
|
OldDirectorySeparators:=AllowDirectorySeparators;
|
||||||
|
{$ifndef Windows}
|
||||||
AllowDirectorySeparators:=[DirectorySeparator];
|
AllowDirectorySeparators:=[DirectorySeparator];
|
||||||
|
{$endif}
|
||||||
Path:=ExtractFilePath(OutFileName);
|
Path:=ExtractFilePath(OutFileName);
|
||||||
OutStream:=Nil;
|
OutStream:=Nil;
|
||||||
If Assigned(FOnCreateStream) then
|
If Assigned(FOnCreateStream) then
|
||||||
@ -1576,10 +1582,12 @@ Begin
|
|||||||
AllowDirectorySeparators:=OldDirectorySeparators;
|
AllowDirectorySeparators:=OldDirectorySeparators;
|
||||||
OutStream:=TFileStream.Create(OutFileName,fmCreate);
|
OutStream:=TFileStream.Create(OutFileName,fmCreate);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
AllowDirectorySeparators:=OldDirectorySeparators;
|
||||||
Result:=True;
|
Result:=True;
|
||||||
If Assigned(FOnStartFile) then
|
If Assigned(FOnStartFile) then
|
||||||
FOnStartFile(Self,OutFileName);
|
FOnStartFile(Self,OutFileName);
|
||||||
|
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user