mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 22:45:07 +00:00
Userland: tar: support extracting gzipped files
This commit is contained in:
parent
b7c7c80ee2
commit
1b3f9c170c
5 changed files with 27 additions and 8 deletions
|
@ -111,7 +111,7 @@ void TarStream::advance()
|
|||
m_finished = true;
|
||||
return;
|
||||
}
|
||||
if (m_header.magic() == "") {
|
||||
if (!valid()) {
|
||||
m_finished = true;
|
||||
return;
|
||||
}
|
||||
|
@ -119,6 +119,11 @@ void TarStream::advance()
|
|||
ASSERT(m_stream.discard_or_error(block_size - sizeof(Header)));
|
||||
}
|
||||
|
||||
bool TarStream::valid() const
|
||||
{
|
||||
return header().magic() == ustar_magic;
|
||||
}
|
||||
|
||||
TarFileStream TarStream::file_contents()
|
||||
{
|
||||
ASSERT(!m_finished);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue