File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ module.exports = function () {
183
183
184
184
// get Unix file permissions
185
185
get fileAttr ( ) {
186
- return uint16 ( _attr >> 16 ) & 0xfff ;
186
+ return ( _attr || 0 ) >> 16 & 0xfff ;
187
187
} ,
188
188
189
189
get offset ( ) {
Original file line number Diff line number Diff line change @@ -142,6 +142,16 @@ describe("headers", () => {
142
142
expect ( head . toJSON ( ) ) . to . eql ( headerdata ) ;
143
143
} ) ;
144
144
145
+ it ( "handles fileAttr when attr above 0x80000000" , ( ) => {
146
+ const attr = 0x81E80000 ;
147
+
148
+ const head = new centralHeader ( ) ;
149
+ head . loadFromBinary ( readBuf ) ;
150
+ head . attr = attr ;
151
+
152
+ expect ( head . fileAttr ) . to . equal ( 0x01E8 ) ;
153
+ } ) ;
154
+
145
155
it ( "read binary and create new binary from it, they have to be equal" , ( ) => {
146
156
const head = new centralHeader ( ) ;
147
157
head . loadFromBinary ( readBuf ) ;
You can’t perform that action at this time.
0 commit comments