summaryrefslogtreecommitdiff
path: root/packages/paszlib
diff options
context:
space:
mode:
authormarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2010-03-21 10:28:29 +0000
committermarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2010-03-21 10:28:29 +0000
commit3894aa51bc709434da8b03d42e9fad649b1bd45f (patch)
tree63614bffda790585d0afb4cffb47ccddb58dee20 /packages/paszlib
parentbb8c7c957a84f906cb83b28cf16d2e5e21ddb89c (diff)
downloadfpc-3894aa51bc709434da8b03d42e9fad649b1bd45f.tar.gz
* 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: http://svn.freepascal.org/svn/fpc/trunk@15025 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/paszlib')
-rwxr-xr-xpackages/paszlib/examples/extractodt.pas2
-rw-r--r--packages/paszlib/src/zipper.pp10
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;