cleanups
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 21 Jul 2025 16:29:35 +0000 (09:29 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 21 Jul 2025 16:29:35 +0000 (09:29 -0700)
21 files changed:
rust/Cargo.lock
rust/pspp/src/main.rs
rust/pspp/src/sys/cooked.rs
rust/pspp/src/sys/encoding.rs
rust/pspp/src/sys/raw.rs
rust/pspp/src/sys/raw/records.rs
rust/pspp/src/sys/test.rs
rust/pspp/src/sys/testdata/zcompressed_data_bad_zheader_ofs.expected
rust/pspp/src/sys/testdata/zcompressed_data_bad_ztrailer_ofs.expected
rust/pspp/src/sys/testdata/zcompressed_data_compressed_sizes_don_t_add_up.expected
rust/pspp/src/sys/testdata/zcompressed_data_compressed_sizes_dont_add_up.expected
rust/pspp/src/sys/testdata/zcompressed_data_compression_expands_data_too_much.expected
rust/pspp/src/sys/testdata/zcompressed_data_invalid_ztrailer_len.expected
rust/pspp/src/sys/testdata/zcompressed_data_uncompressed_size_block_size.expected
rust/pspp/src/sys/testdata/zcompressed_data_wrong_block_size.expected
rust/pspp/src/sys/testdata/zcompressed_data_wrong_compressed_ofs.expected
rust/pspp/src/sys/testdata/zcompressed_data_wrong_n_blocks.expected
rust/pspp/src/sys/testdata/zcompressed_data_wrong_uncompressed_ofs.expected
rust/pspp/src/sys/testdata/zcompressed_data_wrong_ztrailer_bias.expected
rust/pspp/src/sys/testdata/zcompressed_data_wrong_ztrailer_len.expected
rust/pspp/src/sys/testdata/zcompressed_data_wrong_ztrailer_zero.expected

index fb413463d9b10fa39919b71afb79106df68daa72..fbaa4822c8305099c62a31789dbad2062736806b 100644 (file)
@@ -1193,9 +1193,9 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
 
 [[package]]
 name = "libz-rs-sys"
-version = "0.5.0"
+version = "0.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6489ca9bd760fe9642d7644e827b0c9add07df89857b0416ee15c1cc1a3b8c5a"
+checksum = "172a788537a2221661b480fee8dc5f96c580eb34fa88764d3205dc356c7e4221"
 dependencies = [
  "zlib-rs",
 ]
@@ -2876,9 +2876,9 @@ dependencies = [
 
 [[package]]
 name = "zlib-rs"
-version = "0.5.0"
+version = "0.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "868b928d7949e09af2f6086dfc1e01936064cc7a819253bce650d4e2a2d63ba8"
+checksum = "626bd9fa9734751fc50d6060752170984d7053f5a39061f524cda68023d4db8a"
 
 [[package]]
 name = "zopfli"
index 8edd338f1ecf0fe5782aa954acd888ef6e3cc801..dbd9be9f329def0b84812c5b61138cdb59be593c 100644 (file)
@@ -126,10 +126,10 @@ impl Convert {
             eprintln!("warning: {warning}");
         }
 
-        let (dictionary, _, cases) = ReadOptions::new()
+        let (dictionary, _, cases) = ReadOptions::new(warn)
             .with_encoding(self.encoding)
             .with_password(self.password.clone())
-            .open_file(&self.input, warn)?
+            .open_file(&self.input)?
             .into_parts();
 
         // Take only the first `self.max_cases` cases.
@@ -177,7 +177,7 @@ impl Convert {
                     .with_compression(self.sys_options.compression)
                     .write_file(&dictionary, output)?;
                 for case in cases {
-                    output.write_case(&case?)?;
+                    output.write_case(case?.0.iter())?;
                 }
             }
         }
index 11a6c59a9edf7d44afeb35c3429ffdc3e5ee8da8..2651f5fe5ee4ba100a66a9fbd9f69ddb8e2793a4 100644 (file)
@@ -18,7 +18,7 @@ use std::{
     collections::BTreeMap,
     fmt::{Debug, Display},
     fs::File,
-    io::{Read, Seek},
+    io::{BufRead, BufReader, Read, Seek},
     ops::Range,
     path::Path,
 };
@@ -50,7 +50,7 @@ use crate::{
     },
 };
 use anyhow::{anyhow, Error as AnyError};
-use binrw::{io::BufReader, BinRead, BinWrite};
+use binrw::{BinRead, BinWrite};
 use chrono::{NaiveDate, NaiveDateTime, NaiveTime};
 use encoding_rs::Encoding;
 use indexmap::set::MutableValues;
@@ -477,8 +477,11 @@ pub enum Error {
 }
 
 /// Options for reading a system file.
-#[derive(Default, Clone, Debug)]
-pub struct ReadOptions {
+#[derive(Clone, Debug)]
+pub struct ReadOptions<F> {
+    /// Function called to report warnings.
+    pub warn: F,
+
     /// Character encoding for text in the system file.
     ///
     /// If not set, the character encoding will be determined from reading the
@@ -494,11 +497,15 @@ pub struct ReadOptions {
     pub password: Option<String>,
 }
 
-impl ReadOptions {
-    /// Construct a new `ReadOptions` that initially does not specify an
-    /// encoding or password.
-    pub fn new() -> Self {
-        Self::default()
+impl<F> ReadOptions<F> {
+    /// Construct a new `ReadOptions` that reports warnings by calling `warn`
+    /// and initially does not specify an encoding or password.
+    pub fn new(warn: F) -> Self {
+        Self {
+            warn,
+            encoding: None,
+            password: None,
+        }
     }
 
     /// Causes the file to be read using the specified `encoding`, or with a
@@ -513,47 +520,56 @@ impl ReadOptions {
         Self { password, ..self }
     }
 
-    /// Opens the file at `path`, reporting warnings using `warn`.
-    pub fn open_file<P, F>(self, path: P, warn: F) -> Result<SystemFile, AnyError>
+    /// Opens the file at `path`.
+    pub fn open_file<P>(mut self, path: P) -> Result<SystemFile, AnyError>
     where
         P: AsRef<Path>,
         F: FnMut(AnyError),
     {
         let file = File::open(path)?;
-        if self.password.is_some() {
+        if let Some(password) = self.password.take() {
             // Don't create `BufReader`, because [EncryptedReader] will buffer.
-            self.open_reader(file, warn)
+            self.open_reader_encrypted(file, password)
         } else {
-            self.open_reader(BufReader::new(file), warn)
+            Self::open_reader_inner(BufReader::new(file), self.encoding, self.warn)
         }
     }
 
-    /// Opens the file read from `reader`, reporting warnings using `warn`.
-    pub fn open_reader<R, F>(self, reader: R, warn: F) -> Result<SystemFile, AnyError>
+    /// Opens the file read from `reader`.
+    fn open_reader_encrypted<R>(self, reader: R, password: String) -> Result<SystemFile, AnyError>
     where
         R: Read + Seek + 'static,
         F: FnMut(AnyError),
     {
-        if let Some(password) = &self.password {
-            Self::open_reader_inner(
-                EncryptedFile::new(reader)?
-                    .unlock(password.as_bytes())
-                    .map_err(|_| anyhow!("Incorrect password."))?,
-                self.encoding,
-                warn,
-            )
+        Self::open_reader_inner(
+            EncryptedFile::new(reader)?
+                .unlock(password.as_bytes())
+                .map_err(|_| anyhow!("Incorrect password."))?,
+            self.encoding,
+            self.warn,
+        )
+    }
+
+    /// Opens the file read from `reader`.
+    pub fn open_reader<R>(mut self, reader: R) -> Result<SystemFile, AnyError>
+    where
+        R: BufRead + Seek + 'static,
+        F: FnMut(AnyError),
+    {
+        if let Some(password) = self.password.take() {
+            self.open_reader_encrypted(reader, password)
         } else {
-            Self::open_reader_inner(reader, self.encoding, warn)
+            Self::open_reader_inner(reader, self.encoding, self.warn)
         }
     }
 
-    fn open_reader_inner<R, F>(
+    fn open_reader_inner<R>(
         reader: R,
         encoding: Option<&'static Encoding>,
         mut warn: F,
     ) -> Result<SystemFile, AnyError>
     where
-        R: Read + Seek + 'static,
+        R: BufRead + Seek + 'static,
         F: FnMut(AnyError),
     {
         let mut reader = Reader::new(reader, |warning| warn(warning.into()))?;
index 0a2bffcf9b466d36c82c8c43df21757ade4f2890..29a4f9e45f1486633b1cbe31aaeab5ac552cb3b1 100644 (file)
@@ -15,6 +15,8 @@
 // this program.  If not, see <http://www.gnu.org/licenses/>.
 
 //! Character encodings in system files.
+//!
+//! These are useful for reading and writing system files at a low level.
 
 use std::sync::LazyLock;
 
index f37c5a7faf7075c82bb075cf74abb73a429525de..60b5619f4e5035c2a20f496257bfc7cda4345b2e 100644 (file)
@@ -44,14 +44,14 @@ use crate::{
 };
 
 use encoding_rs::Encoding;
-use flate2::read::ZlibDecoder;
+use flate2::bufread::ZlibDecoder;
 use smallvec::SmallVec;
 use std::{
     borrow::Cow,
     cell::RefCell,
     collections::VecDeque,
     fmt::{Debug, Display, Formatter, Result as FmtResult},
-    io::{empty, Error as IoError, Read, Seek, SeekFrom},
+    io::{empty, BufRead, Error as IoError, Read, Seek, SeekFrom},
     iter::repeat_n,
     mem::take,
     num::NonZeroU8,
@@ -610,7 +610,7 @@ impl Record {
         warn: &mut dyn FnMut(Warning),
     ) -> Result<Option<Record>, Error>
     where
-        R: Read + Seek,
+        R: BufRead + Seek,
     {
         let rec_type: u32 = endian.parse(read_bytes(reader)?);
         match rec_type {
@@ -1073,34 +1073,41 @@ impl Datum {
 
 struct ZlibDecodeMultiple<R>
 where
-    R: Read + Seek,
+    R: BufRead + Seek,
 {
     reader: Option<ZlibDecoder<R>>,
+    limit: u64,
 }
 
 impl<R> ZlibDecodeMultiple<R>
 where
-    R: Read + Seek,
+    R: BufRead + Seek,
 {
-    fn new(reader: R) -> ZlibDecodeMultiple<R> {
+    fn new(reader: R, limit: u64) -> ZlibDecodeMultiple<R> {
         ZlibDecodeMultiple {
             reader: Some(ZlibDecoder::new(reader)),
+            limit,
         }
     }
 }
 
 impl<R> Read for ZlibDecodeMultiple<R>
 where
-    R: Read + Seek,
+    R: BufRead + Seek,
 {
     fn read(&mut self, buf: &mut [u8]) -> Result<usize, IoError> {
         loop {
-            match self.reader.as_mut().unwrap().read(buf)? {
-                0 => {
-                    let inner = self.reader.take().unwrap().into_inner();
+            match self.reader.as_mut().unwrap().read(buf) {
+                Err(error) => return Err(error),
+                Ok(0) => {
+                    let mut inner = self.reader.take().unwrap().into_inner();
+                    let position = inner.stream_position();
                     self.reader = Some(ZlibDecoder::new(inner));
+                    if position? >= self.limit {
+                        return Ok(0);
+                    }
                 }
-                n => return Ok(n),
+                Ok(n) => return Ok(n),
             };
         }
     }
@@ -1108,7 +1115,7 @@ where
 
 impl<R> Seek for ZlibDecodeMultiple<R>
 where
-    R: Read + Seek,
+    R: BufRead + Seek,
 {
     fn seek(&mut self, pos: SeekFrom) -> Result<u64, IoError> {
         self.reader.as_mut().unwrap().get_mut().seek(pos)
@@ -1125,7 +1132,7 @@ enum ReaderState {
 /// Reads records from a system file in their raw form.
 pub struct Reader<'a, R>
 where
-    R: Read + Seek + 'static,
+    R: BufRead + Seek + 'static,
 {
     reader: Option<R>,
     warn: Box<dyn FnMut(Warning) + 'a>,
@@ -1139,7 +1146,7 @@ where
 
 impl<'a, R> Reader<'a, R>
 where
-    R: Read + Seek + 'static,
+    R: BufRead + Seek + 'static,
 {
     /// Constructs a new [Reader] from the underlying `reader`.  Any warnings
     /// encountered while reading the system file will be reported with `warn`.
@@ -1182,18 +1189,19 @@ where
 /// Reads raw records from a system file.
 pub struct Records<'a, 'b, R>(&'b mut Reader<'a, R>)
 where
-    R: Read + Seek + 'static;
+    R: BufRead + Seek + 'static;
 
 impl<'a, 'b, R> Records<'a, 'b, R>
 where
-    R: Read + Seek + 'static,
+    R: BufRead + Seek + 'static,
 {
-    fn cases(&mut self) {
+    fn cases(&mut self, ztrailer_offset: Option<u64>) {
         self.0.state = ReaderState::End;
         self.0.cases = Some(Cases::new(
             self.0.reader.take().unwrap(),
             take(&mut self.0.var_types),
             &self.0.header,
+            ztrailer_offset,
         ));
     }
 
@@ -1218,7 +1226,7 @@ where
                         self.0.state = if let Some(Compression::ZLib) = self.0.header.compression {
                             ReaderState::ZlibHeader
                         } else {
-                            self.cases();
+                            self.cases(None);
                             ReaderState::End
                         };
                     }
@@ -1244,11 +1252,11 @@ where
                     &mut self.0.warn,
                 ) {
                     Ok(None) => {
-                        self.cases();
+                        self.cases(Some(zheader.inner.ztrailer_offset));
                         None
                     }
                     Ok(Some(ztrailer)) => {
-                        self.cases();
+                        self.cases(Some(zheader.inner.ztrailer_offset));
                         Some(Ok(Record::ZTrailer(ztrailer)))
                     }
                     Err(error) => Some(Err(error)),
@@ -1261,7 +1269,7 @@ where
 
 impl<'a, 'b, R> Iterator for Records<'a, 'b, R>
 where
-    R: Read + Seek + 'static,
+    R: BufRead + Seek + 'static,
 {
     type Item = Result<Record, Error>;
 
@@ -1386,13 +1394,18 @@ impl Default for Cases {
 }
 
 impl Cases {
-    fn new<R>(reader: R, var_types: VarTypes, header: &FileHeader<RawString>) -> Self
+    fn new<R>(
+        reader: R,
+        var_types: VarTypes,
+        header: &FileHeader<RawString>,
+        ztrailer_offset: Option<u64>,
+    ) -> Self
     where
-        R: Read + Seek + 'static,
+        R: BufRead + Seek + 'static,
     {
         Self {
             reader: if header.compression == Some(Compression::ZLib) {
-                Box::new(ZlibDecodeMultiple::new(reader))
+                Box::new(ZlibDecodeMultiple::new(reader, ztrailer_offset.unwrap()))
             } else {
                 Box::new(reader)
             },
index d0edb810fef126433c26129bef7de4a08eb25a01..714f7b4af4c850dfab0865d4eaa7b02769162f0e 100644 (file)
@@ -854,7 +854,7 @@ pub struct IntegerInfoRecord {
     pub inner: RawIntegerInfoRecord,
 }
 
-/// Machine integer info record in [binrw] format.
+/// Machine integer info record in [mod@binrw] format.
 #[derive(Clone, Debug, BinRead, BinWrite)]
 pub struct RawIntegerInfoRecord {
     /// Version number.
@@ -2373,6 +2373,7 @@ pub struct ZHeader {
     pub inner: RawZHeader,
 }
 
+/// A ZLIB header in a system file.
 #[derive(Clone, Debug, BinRead, BinWrite)]
 pub struct RawZHeader {
     /// File offset to the ZLIB data header.
@@ -2417,6 +2418,7 @@ impl ZHeader {
 /// Error reading a [ZHeader].
 #[derive(ThisError, Debug)]
 pub enum ZHeaderError {
+    /// I/O error via [mod@binrw].
     #[error("{}", DisplayBinError(&.0, "ZLIB header"))]
     BinError(#[from] BinError),
 
@@ -2427,9 +2429,8 @@ pub enum ZHeaderError {
         u64,
     ),
 
-    /// ZLIB header's zlib_offset is {actual:#x} instead of expected
-    /// {expected:#x}.
-    #[error("ZLIB header's zlib_offset is {actual:#x} instead of expected {expected:#x}.")]
+    /// zlib_offset is {actual:#x} instead of expected {expected:#x}.
+    #[error("zlib_offset is {actual:#x} instead of expected {expected:#x}.")]
     UnexpectedZHeaderOffset {
         /// Actual `zlib_offset`.
         actual: u64,
@@ -2451,9 +2452,11 @@ pub struct ZTrailer {
     /// File offset to the start of the record.
     pub offset: u64,
 
+    /// The raw trailer.
     pub inner: RawZTrailer,
 }
 
+/// A ZLIB trailer in a system file.
 #[binrw]
 #[derive(Clone, Debug)]
 pub struct RawZTrailer {
@@ -2477,6 +2480,7 @@ pub struct RawZTrailer {
 }
 
 impl RawZTrailer {
+    /// Returns the length of the trailer when it is written, in bytes.
     pub fn len(&self) -> usize {
         24 + self.blocks.len() * 24
     }
@@ -2487,7 +2491,7 @@ impl RawZTrailer {
 pub enum ZlibTrailerWarning {
     /// Wrong block size.
     #[error(
-        "ZLIB block descriptor {index} reported block size {actual:#x}, when {expected:#x} was expected."
+        "Block descriptor {index} reported block size {actual:#x}, when {expected:#x} was expected."
     )]
     ZlibTrailerBlockWrongSize {
         /// 0-based block descriptor index.
@@ -2500,7 +2504,7 @@ pub enum ZlibTrailerWarning {
 
     /// Block too big.
     #[error(
-        "ZLIB block descriptor {index} reported block size {actual:#x}, when at most {max_expected:#x} was expected."
+        "Block descriptor {index} reported block size {actual:#x}, when at most {max_expected:#x} was expected."
     )]
     ZlibTrailerBlockTooBig {
         /// 0-based block descriptor index.
@@ -2560,13 +2564,14 @@ impl<'a> Display for DisplayBinError<'a> {
 /// Error reading a [ZTrailer].
 #[derive(ThisError, Debug)]
 pub enum ZTrailerError {
+    /// I/O error via [mod@binrw].
     #[error("{}", DisplayBinError(&.0, "ZLIB trailer"))]
     BinError(#[from] BinError),
 
     /// ZLIB trailer bias {actual} is not {} as expected from file header bias.
     #[
         error(
-        "ZLIB trailer bias {actual} is not {} as expected from file header bias.",
+        "Bias {actual} is not {} as expected from file header.",
         DisplayPlainF64(*expected)
     )]
     WrongZlibTrailerBias {
@@ -2576,24 +2581,24 @@ pub enum ZTrailerError {
         expected: f64,
     },
 
-    /// ZLIB trailer \"zero\" field has nonzero value {0}.
-    #[error("ZLIB trailer \"zero\" field has nonzero value {0}.")]
+    /// ZLIB trailer zero field has nonzero value {0}.
+    #[error("Expected zero field has nonzero value {0}.")]
     WrongZlibTrailerZero(
         /// Actual value that should have been zero.
         u64,
     ),
 
     /// ZLIB trailer specifies unexpected {0}-byte block size.
-    #[error("ZLIB trailer specifies unexpected {0}-byte block size.")]
+    #[error("Unexpected {0:x}-byte block size (expected 0x3ff000).")]
     WrongZlibTrailerBlockSize(
         /// Block size read from file.
         u32,
     ),
 
-    /// Block count in ZLIB trailer differs from expected block count calculated
-    /// from trailer length.
+    /// Block count differs from expected block count calculated from trailer
+    /// length.
     #[error(
-        "Block count {n_blocks} in ZLIB trailer differs from expected block count {expected_n_blocks} calculated from trailer length {ztrailer_len}."
+        "Block count {n_blocks} differs from expected block count {expected_n_blocks} calculated from trailer length {ztrailer_len}."
     )]
     BadZlibTrailerNBlocks {
         /// Number of blocks.
@@ -2607,7 +2612,7 @@ pub enum ZTrailerError {
     /// ZLIB block descriptor reported uncompressed data offset different from
     /// expected.
     #[error(
-        "ZLIB block descriptor {index} reported uncompressed data offset {actual:#x}, when {expected:#x} was expected."
+        "Block descriptor {index} reported uncompressed data offset {actual:#x}, when {expected:#x} was expected."
     )]
     ZlibTrailerBlockWrongUncmpOfs {
         /// Block descriptor index.
@@ -2618,10 +2623,10 @@ pub enum ZTrailerError {
         expected: u64,
     },
 
-    /// ZLIB block descriptor {index} reported compressed data offset
+    /// Block descriptor {index} reported compressed data offset
     /// {actual:#x}, when {expected:#x} was expected.
     #[error(
-        "ZLIB block descriptor {index} reported compressed data offset {actual:#x}, when {expected:#x} was expected."
+        "Block descriptor {index} reported compressed data offset {actual:#x}, when {expected:#x} was expected."
     )]
     ZlibTrailerBlockWrongCmpOfs {
         /// Block descriptor index.
@@ -2632,10 +2637,10 @@ pub enum ZTrailerError {
         expected: u64,
     },
 
-    /// ZLIB block descriptor {index} reports compressed size {compressed_size}
+    /// Block descriptor {index} reports compressed size {compressed_size}
     /// and uncompressed size {uncompressed_size}.
     #[error(
-        "ZLIB block descriptor {index} reports compressed size {compressed_size} and uncompressed size {uncompressed_size}."
+        "Block descriptor {index} reports compressed size {compressed_size} and uncompressed size {uncompressed_size}."
     )]
     ZlibExpansion {
         /// Block descriptor index.
index a5fd40b92b6ab418e51b52bdf947e448540ee2ab..722bcf04ebd39ebff9f063d246dbc75e071684a4 100644 (file)
@@ -16,7 +16,7 @@
 
 use std::{
     fs::File,
-    io::{Cursor, Read, Seek},
+    io::{BufRead, BufReader, Cursor, Seek},
     path::Path,
     sync::Arc,
 };
@@ -553,11 +553,11 @@ fn encrypted_file() {
 
 #[test]
 fn encrypted_file_without_password() {
-    let error = ReadOptions::new()
-        .open_file("src/crypto/testdata/test-encrypted.sav", |_| {
-            panic!();
-        })
-        .unwrap_err();
+    let error = ReadOptions::new(|_| {
+        panic!();
+    })
+    .open_file("src/crypto/testdata/test-encrypted.sav")
+    .unwrap_err();
     assert!(matches!(
         error.downcast::<raw::Error>().unwrap().details,
         ErrorDetails::Encrypted
@@ -569,7 +569,7 @@ fn test_raw_sysfile(name: &str) {
         .join("src/sys/testdata")
         .join(name)
         .with_extension("sav");
-    let sysfile = File::open(&input_filename).unwrap();
+    let sysfile = BufReader::new(File::open(&input_filename).unwrap());
     let expected_filename = input_filename.with_extension("expected");
     let expected = String::from_utf8(std::fs::read(&expected_filename).unwrap()).unwrap();
     test_sysfile(sysfile, &expected, &expected_filename);
@@ -612,10 +612,10 @@ fn test_sack_sysfile(name: &str) {
 
 fn test_sysfile<R>(sysfile: R, expected: &str, expected_filename: &Path)
 where
-    R: Read + Seek + 'static,
+    R: BufRead + Seek + 'static,
 {
     let mut warnings = Vec::new();
-    let output = match ReadOptions::new().open_reader(sysfile, |warning| warnings.push(warning)) {
+    let output = match ReadOptions::new(|warning| warnings.push(warning)).open_reader(sysfile) {
         Ok(system_file) => {
             let (dictionary, metadata, cases) = system_file.into_parts();
             let (group, data) = metadata.to_pivot_rows();
index 6c8ffda947cc1bc29e2246e1793f895fcf53ae6c..ef5d97d1e87df8cd0852dc188a1c24b9133eb047 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x194 to 0x1a0: ZLIB header's zlib_offset is 0x0 instead of expected 0x194.
+Error at file offsets 0x194 to 0x1a0: Error reading ZLIB header: zlib_offset is 0x0 instead of expected 0x194.
index 83cbe679c8780369d76a3a6ec25c8576ae910a0b..ca2d02b3b9d58eade3d650f8bae110de6bde37d5 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x194 to 0x1a0: Impossible ztrailer_offset 0x0.
+Error at file offsets 0x194 to 0x1a0: Error reading ZLIB header: Impossible ztrailer_offset 0x0.
index 6b728bdfe4aa444eeaffa762598eff1404a412b6..b99f89055b256a3bfa3b7064a09ffc0184a10115 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x1ac to 0x1dc: ZLIB trailer is at offset 0x205 but 0x204 would be expected from block descriptors.
+Error at file offsets 0x1ac to 0x1dc: Error reading ZLIB trailer: ZLIB trailer is at offset 0x205 but 0x204 would be expected from block descriptors.
index effe1768fb6e33747b81576ef98facc1b3a01584..e90459a4a9beb95ecc1917272e4fb7072ea8926f 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x1dc to 0x1f4: ZLIB block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
+Error at file offsets 0x1dc to 0x1f4: Error reading ZLIB trailer: Block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
index 8196e26acadbbe25042ed7c519f58d0da5ddbdb0..3e46bb92a3f6197ab6cc93f3d6fa2bd6a599d0ef 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x1c4 to 0x1dc: ZLIB block descriptor 0 reports compressed size 100 and uncompressed size 50.
+Error at file offsets 0x1c4 to 0x1dc: Error reading ZLIB trailer: Block descriptor 0 reports compressed size 100 and uncompressed size 50.
index b70a425e02056f5539dddf8e135ebd4202d96a85..d78157a697eefa33b1ad853b99a4a658462d1b50 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x194 to 0x1a0: Invalid ZLIB trailer length 21.
+Error at file offsets 0x194 to 0x1a0: Error reading ZLIB header: Invalid ZLIB trailer length 21.
index 00be8d426781c171b62414ca3cd4a511ab890353..c12460b4f5aa3a453676f5f1c28f9e2369f8a3c8 100644 (file)
@@ -1,4 +1,4 @@
-Warning at file offsets 0x1c4 to 0x1dc: In ZLIB trailer: ZLIB block descriptor 0 reported block size 0x400000, when at most 0x3ff000 was expected.
+Warning at file offsets 0x1c4 to 0x1dc: In ZLIB trailer: Block descriptor 0 reported block size 0x400000, when at most 0x3ff000 was expected.
 
 ╭──────────────────────┬────────────────────────╮
 │       Created        │    01-JAN-2011 20:53:52│
index 82c0c1b127396b8e4e83f8c386144f73b3b209ca..5af8bd1e20082056da7ed0d3d19b2a4702e7f313 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x1ac to 0x1c4: ZLIB trailer specifies unexpected 4096-byte block size.
+Error at file offsets 0x1ac to 0x1c4: Error reading ZLIB trailer: Unexpected 1000-byte block size (expected 0x3ff000).
index a7e4b4b93545de48da75d3dde9fba1174ebe891f..272feb052a636268b6c42b880288ff72dd094e3b 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x1c4 to 0x1dc: ZLIB block descriptor 0 reported compressed data offset 0x191, when 0x1ac was expected.
+Error at file offsets 0x1c4 to 0x1dc: Error reading ZLIB trailer: Block descriptor 0 reported compressed data offset 0x191, when 0x1ac was expected.
index 37a9a2d4223593b0bc6e228b4fae84991bcffd98..eef81e946c2304765073c9a050f05f50ad27bf8a 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x1ac to 0x1c4: Block count 2 in ZLIB trailer differs from expected block count 1 calculated from trailer length 48.
+Error at file offsets 0x205 to 0x235: Error reading ZLIB trailer: Unexpected end-of-file reading ZLIB trailer
index ef1bb440f7abd6c9218ca22736e7288b24cbe69e..d3630620776bfc998f52318cf80b82310689c8a2 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x1c4 to 0x1dc: ZLIB block descriptor 0 reported uncompressed data offset 0x177, when 0x1ac was expected.
+Error at file offsets 0x1c4 to 0x1dc: Error reading ZLIB trailer: Block descriptor 0 reported uncompressed data offset 0x177, when 0x1ac was expected.
index d084ea52567683aa3b084c097071939f0cd8cf00..5017da8b03cdc1a439156e9d1e211b1e6ec09ada 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x1ac to 0x1c4: ZLIB trailer bias 0 is not -100 as expected from file header bias.
+Error at file offsets 0x1ac to 0x1c4: Error reading ZLIB trailer: Bias 0 is not -100 as expected from file header.
index a9d98d29b5d41a49522d7f025c465b1737fb1723..ba66bc99c3760995ee76a6ea3e549ab2397b5495 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x1ac to 0x1c4: Block count 1 in ZLIB trailer differs from expected block count 2 calculated from trailer length 72.
+Error at file offsets 0x1ac to 0x1c4: Error reading ZLIB trailer: Block count 1 differs from expected block count 2 calculated from trailer length 72.
index 73f5cfd137509332ec8e094d5d1fd4540a2c844b..578775cc31e0d5243c4aaa3a8c4578ca221fcd2a 100644 (file)
@@ -1 +1 @@
-Error at file offsets 0x1ac to 0x1c4: ZLIB trailer "zero" field has nonzero value 100.
+Error at file offsets 0x1ac to 0x1c4: Error reading ZLIB trailer: Expected zero field has nonzero value 100.