** Buffer aExtra (size nExtra bytes) contains zip archive "extra" fields. ** Scan through this buffer to find an "extra-timestamp" field. If one ** exists, extract the 32-bit modification-timestamp from it and store ** the value in output parameter *pmTime. ** ** Zero is returned if no extra-timestamp record could be found (and so ** *pmTime is left unchanged), or non-zero otherwise. ** ** The gen
| 6545 | ** Data N bytes |
| 6546 | */ |
| 6547 | static int zipfileScanExtra(u8 *aExtra, int nExtra, u32 *pmTime){ |
| 6548 | int ret = 0; |
| 6549 | u8 *p = aExtra; |
| 6550 | u8 *pEnd = &aExtra[nExtra]; |
| 6551 | |
| 6552 | while( p<pEnd ){ |
| 6553 | u16 id = zipfileRead16(p); |
| 6554 | u16 nByte = zipfileRead16(p); |
| 6555 | |
| 6556 | switch( id ){ |
| 6557 | case ZIPFILE_EXTRA_TIMESTAMP: { |
| 6558 | u8 b = p[0]; |
| 6559 | if( b & 0x01 ){ /* 0x01 -> modtime is present */ |
| 6560 | *pmTime = zipfileGetU32(&p[1]); |
| 6561 | ret = 1; |
| 6562 | } |
| 6563 | break; |
| 6564 | } |
| 6565 | } |
| 6566 | |
| 6567 | p += nByte; |
| 6568 | } |
| 6569 | return ret; |
| 6570 | } |
| 6571 | |
| 6572 | /* |
| 6573 | ** Convert the standard MS-DOS timestamp stored in the mTime and mDate |
no test coverage detected