mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:34:59 +00:00
tar: Implement usage of prefixes when extracting
This commit is contained in:
parent
07351762c7
commit
0d679bf348
1 changed files with 7 additions and 1 deletions
|
@ -76,7 +76,13 @@ int main(int argc, char** argv)
|
|||
Archive::TarFileStream file_stream = tar_stream.file_contents();
|
||||
|
||||
const Archive::TarFileHeader& header = tar_stream.header();
|
||||
String absolute_path = Core::File::absolute_path(header.filename());
|
||||
|
||||
LexicalPath path = LexicalPath(header.filename());
|
||||
if (!header.prefix().is_empty())
|
||||
path = path.prepend(header.prefix());
|
||||
|
||||
String absolute_path = Core::File::absolute_path(path.string());
|
||||
|
||||
switch (header.type_flag()) {
|
||||
case Archive::TarFileType::NormalFile:
|
||||
case Archive::TarFileType::AlternateNormalFile: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue