From b6ca690095045882b8f1767f8bc5a9b04e062b9d Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Thu, 14 Nov 2019 17:42:15 +0100 Subject: [PATCH] src/pxar/decoder.rs: return also payload size in lookup Signed-off-by: Christian Ebner --- src/pxar/decoder.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pxar/decoder.rs b/src/pxar/decoder.rs index 2ce89b58..60a19ba6 100644 --- a/src/pxar/decoder.rs +++ b/src/pxar/decoder.rs @@ -266,7 +266,7 @@ impl Result<(), Error>> Decoder { &mut self, dir: &DirectoryEntry, filename: &OsStr, - ) -> Result, Error> { + ) -> Result, Error> { let gbt = self.goodbye_table(Some(dir.start), dir.end)?; let hash = compute_goodbye_hash(filename.as_bytes()); @@ -284,7 +284,7 @@ impl Result<(), Error>> Decoder { // the start of an item (PXAR_FILENAME) or the GOODBYE_TAIL_MARKER in // case of directories, so the use of start offset is fine for both // cases. - let (entry_name, entry, attr, _payload_size) = self.attributes(*start)?; + let (entry_name, entry, attr, payload_size) = self.attributes(*start)?; // Possible hash collision, need to check if the found entry is indeed // the filename to lookup. @@ -295,7 +295,7 @@ impl Result<(), Error>> Decoder { filename: entry_name, entry, }; - return Ok(Some((dir_entry, attr))); + return Ok(Some((dir_entry, attr, payload_size))); } } }