Skip to content

Commit

Permalink
LibArchive: Add TarFileHeader::content_is_like_extended_header()
Browse files Browse the repository at this point in the history
  • Loading branch information
timschumi authored and awesomekling committed Mar 5, 2022
1 parent e2d7182 commit e0dba2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Userland/Libraries/LibArchive/Tar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ void TarFileHeader::calculate_checksum()
VERIFY(String::formatted("{:06o}", expected_checksum()).copy_characters_to_buffer(m_checksum, sizeof(m_checksum)));
}

bool TarFileHeader::content_is_like_extended_header() const
{
return type_flag() == TarFileType::ExtendedHeader || type_flag() == TarFileType::GlobalExtendedHeader;
}

}
2 changes: 2 additions & 0 deletions Userland/Libraries/LibArchive/Tar.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ class [[gnu::packed]] TarFileHeader {
unsigned expected_checksum() const;
void calculate_checksum();

bool content_is_like_extended_header() const;

private:
char m_filename[100] { 0 };
char m_mode[8] { 0 };
Expand Down

0 comments on commit e0dba2b

Please sign in to comment.