]> git.tdb.fi Git - libs/datafile.git/commitdiff
Pass mode to ZlibCompressed
authorMikko Rasa <tdb@tdb.fi>
Sat, 5 Jan 2013 09:40:42 +0000 (11:40 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 5 Jan 2013 11:01:49 +0000 (13:01 +0200)
This makes creating compressed packs work.  The temporary file is opened
with M_RDWR because we want to read the data back from the same handle, so
ZlibCompressed can't autodetect the mode.

source/input.cpp
source/output.cpp

index a1d462a770d320f0a13c59175459fc8c131186b4..4a44dea05228ae14d1d91e698ebe4eecf98cb662 100644 (file)
@@ -18,7 +18,7 @@ Input::~Input()
 
 void Input::set_decompress()
 {
-       compressed = new IO::ZlibCompressed(*in);
+       compressed = new IO::ZlibCompressed(*in, IO::M_READ);
        in = compressed;
 }
 
index f2e90640077c9f6ed0f906b0d119322e7468c354..2d33810b5b86d720db9ec437d689ff4e3c57a554 100644 (file)
@@ -18,7 +18,7 @@ Output::~Output()
 
 void Output::set_compressed()
 {
-       compressed = new IO::ZlibCompressed(*out);
+       compressed = new IO::ZlibCompressed(*out, IO::M_WRITE);
        out = compressed;
 }