alexcrichton / tar-rs

Tar file reading/writing for Rust
https://docs.rs/tar
Apache License 2.0
616 stars 178 forks source link

TarBuilder::append_path_with_name ignores name if path is a "special" file #327

Open tp971 opened 1 year ago

tp971 commented 1 year ago

When append_path_with_name is given a "special" file (i.e. a file that is not a file, directory or symlink), it ignores the given name. I quickly glanced over the code and I think the fix is just to replace path by ar_name when calling append_special in builder.rs line 463: https://github.com/alexcrichton/tar-rs/blob/f4f439ca0cd3a984d2a66fb8e42f6e2307876afd/src/builder.rs#LL463C33-L463C37