mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-10-12 05:07:15 +03:00
tar: Implement usage of prefixes when extracting
This commit is contained in:
parent
07351762c7
commit
0d679bf348
Notes:
sideshowbarker
2024-07-18 00:52:57 +09:00
Author: https://github.com/timschumi Commit: https://github.com/SerenityOS/serenity/commit/0d679bf3489 Pull-request: https://github.com/SerenityOS/serenity/pull/11000
@ -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…
Reference in New Issue
Block a user