catalog: fix issue with DirEntry start

start has to be the parent start - offset

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2019-11-12 16:34:33 +01:00 committed by Dietmar Maurer
parent 780dd2b0a1
commit b423958d8e

View File

@ -440,7 +440,7 @@ impl <R: Read + Seek> CatalogReader<R> {
let mut entry_list = Vec::new();
DirInfo::parse(&data, |etype, name, offset, size, mtime| {
let entry = DirEntry::new(etype, name.to_vec(), offset, size, mtime);
let entry = DirEntry::new(etype, name.to_vec(), start - offset, size, mtime);
entry_list.push(entry);
Ok(true)
})?;
@ -468,7 +468,7 @@ impl <R: Read + Seek> CatalogReader<R> {
return Ok(true);
}
let entry = DirEntry::new(etype, name.to_vec(), offset, size, mtime);
let entry = DirEntry::new(etype, name.to_vec(), start - offset, size, mtime);
item = Some(entry);
Ok(false) // stop parsing
})?;