-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #4060 #4068
Fixes #4060 #4068
Changes from 2 commits
fbbb28d
3bf43a2
afb3b45
b85e204
3ae17c4
6260cfd
b7ef87c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,8 @@ class Gzip::Header | |
xlen = io.read_byte.not_nil! | ||
@extra = Bytes.new(xlen) | ||
io.read_fully(@extra) | ||
else | ||
@extra = Bytes.empty | ||
end | ||
|
||
if flg.name? | ||
|
@@ -71,7 +73,7 @@ class Gzip::Header | |
|
||
# flg | ||
flg = Flg::None | ||
flg |= Flg::EXTRA if @extra | ||
flg |= Flg::EXTRA if !@extra.empty? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have done... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks |
||
flg |= Flg::NAME if @name | ||
flg |= Flg::COMMENT if @comment | ||
io.write_byte flg.value | ||
|
@@ -85,8 +87,8 @@ class Gzip::Header | |
# os | ||
io.write_byte os | ||
|
||
if extra = @extra | ||
io.write_byte extra.size.to_u8 | ||
if !@extra.empty? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto |
||
io.write_byte @extra.size.to_u8 | ||
io.write(extra) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't this also refer to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think you're right. It used to copy the value, I'm guessing there isn't a test case for gzip with extra set. I'll update. |
||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is not needed,
@extra
should always be initialized. Right now it doesn't work because of #3988