Skip to content

Commit

Permalink
fix: Write very long filenames in GNUtar format correctly
Browse files Browse the repository at this point in the history
Closes: #45
Closes: #47
  • Loading branch information
halostatue committed Aug 6, 2024
1 parent b51e325 commit 19d7ba5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ Thanks to everyone who has contributed to minitar:
- Mike Furr
- ooooooo_q
- Pete Fritchman
- Zach Dennis
- Vijay (bv-vijay)
- Yamamoto Kōhei
- Zach Dennis

[minitest]: https://github.com/seattlerb/minitest
[quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
Expand Down
4 changes: 4 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## 0.12 / 2024-08-DD

- Properly handle very long GNU filenames, resolving [#46][].
- Handle very long GNU filenames that are 512 or more bytes, resolving [#45][].
Originally implemented in [#47][] by Vijay, but accidentally closed.

## 0.11 / 2022-12-31

Expand Down Expand Up @@ -194,4 +196,6 @@
[#40]: https://github.com/halostatue/minitar/pull/40
[#42]: https://github.com/halostatue/minitar/pull/42
[#43]: https://github.com/halostatue/minitar/pull/43
[#45]: https://github.com/halostatue/minitar/issues/45
[#46]: https://github.com/halostatue/minitar/issues/46
[#47]: https://github.com/halostatue/minitar/pull/47
2 changes: 1 addition & 1 deletion lib/archive/tar/minitar/writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def write_header(header, long_name, short_name, prefix, needs_long_name)
:prefix => "",
:name => PosixHeader::GNU_EXT_LONG_LINK,
:typeflag => "L",
:size => long_name.length,
:size => long_name.length + 1,
:mode => 0
}
@io.write(PosixHeader.new(long_name_header))
Expand Down

0 comments on commit 19d7ba5

Please sign in to comment.