File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ module.exports = function () {
183183
184184 // get Unix file permissions
185185 get fileAttr ( ) {
186- return uint16 ( _attr >> 16 ) & 0xfff ;
186+ return ( _attr || 0 ) >> 16 & 0xfff ;
187187 } ,
188188
189189 get offset ( ) {
Original file line number Diff line number Diff line change @@ -142,6 +142,16 @@ describe("headers", () => {
142142 expect ( head . toJSON ( ) ) . to . eql ( headerdata ) ;
143143 } ) ;
144144
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+
145155 it ( "read binary and create new binary from it, they have to be equal" , ( ) => {
146156 const head = new centralHeader ( ) ;
147157 head . loadFromBinary ( readBuf ) ;
You can’t perform that action at this time.
0 commit comments