mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +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();
|
Archive::TarFileStream file_stream = tar_stream.file_contents();
|
||||||
|
|
||||||
const Archive::TarFileHeader& header = tar_stream.header();
|
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()) {
|
switch (header.type_flag()) {
|
||||||
case Archive::TarFileType::NormalFile:
|
case Archive::TarFileType::NormalFile:
|
||||||
case Archive::TarFileType::AlternateNormalFile: {
|
case Archive::TarFileType::AlternateNormalFile: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue