Commit Graph

13 Commits

Author SHA1 Message Date
Robert Haines 765cb316f1 Fix reading unknown extra fields.
When loading extra fields from both the central directory and local headers,
unknown fields were not merged correctly. They were being appended, which
means that we end up with the two versions stuck together - in some
cases duplicating the field completely.

This broke all kinds of things (like calculating the size of a local
header) in subtle ways.

This commit fixes this by implementing a new `Unknown` extra field type,
and making sure that when reading local and central extra fields they
are stored and preserved correctly. We cannot assume the unknown fields
use the same data in the local and central headers.

Fixes #505.
2021-11-19 19:53:38 +00:00
Robert Haines e10badf68e Fix Style/FrozenStringLiteralComment cop. 2021-05-25 21:24:50 +01:00
Taichi Ishitani 0e4dc676a0 fix frozen string literal error 2021-05-25 21:24:50 +01:00
Robert Haines 0235e76bae Test packing the NTFS extra field. 2020-10-03 18:27:20 +01:00
Robert Haines a668fd14d2 Test reading an extra field with a bad header ID. 2020-10-03 18:27:20 +01:00
Robert Haines b00c47a047 Add a failing test for reading local extra fields. 2020-09-20 14:41:24 +01:00
Pavel Lobashov 1ba81ff46f fix rubocop Style/NumericLiterals cop 2015-03-23 19:23:04 +03:00
Pavel Lobashov b93ef1266f fix rubocop Style/StringLiterals cop 2015-03-21 11:27:44 +03:00
Pavel Lobashov b9a757e045 fix rubocop Style/EmptyLinesAroundClassBody cop 2015-03-21 11:21:26 +03:00
Pavel Lobashov d0c8e8df60 fix rubocop Style/EmptyLines cop 2015-03-21 11:19:14 +03:00
Henry Yang a7a11e33bd NTFS Extra Field (0x000a) support 2014-09-11 23:04:23 -07:00
Robert Haines 9785b66a43 Update tests to use the minitest 5.x API.
MiniTest::Unit::TestCase -> MiniTest::Test
MiniTest::Unit.after_tests -> MiniTest.after_run
2014-07-23 12:59:13 +03:00
Alexander Simonov 58f08ca0e1 Split all tests to small files. Move to minitest 2014-01-20 23:31:06 +02:00