*** [-.dist.zip]vms_pk.c --- vms_pk.c ************** *** 21,26 * PKWARE. * Incompatibility (?): zip produces multiple ACE * fields. */ #include --- 21,28 ----- * PKWARE. * Incompatibility (?): zip produces multiple ACE * fields. + * version 2.1-1 Clean extra fields in vms_get_attributes(). + * Fixed bug with EOF. */ #include ************** *** 203,209 size = 16*KByte; else if(size > 512) size &= ~511L; /* Round to integer number of blocks */ ! do { status = sys$qiow(0, ctx->chan, IO$_READVBLK, &ctx->iosb, 0, 0, --- 205,211 ----- size = 16*KByte; else if(size > 512) size &= ~511L; /* Round to integer number of blocks */ ! do { status = sys$qiow(0, ctx->chan, IO$_READVBLK, &ctx->iosb, 0, 0, ************** *** 218,224 if( !ERR(status) || status == SS$_ENDOFFILE ) { register int count; ! count = ctx->iosb.count; size -= count; buf += count; nr += count; --- 220,231 ----- if( !ERR(status) || status == SS$_ENDOFFILE ) { register int count; ! ! if( status == SS$_ENDOFFILE ) ! count = ctx->rest; ! else ! count = ctx->iosb.count; ! size -= count; buf += count; nr += count; ************** *** 268,274 return 0; } ! /*----------------------* | vms_get_attributes() | *----------------------* | Returns pointer to malloc'ed PKWARE extra field with file attributes. --- 275,281 ----- return 0; } ! /*--------------------------* | vms_get_attributes() | *--------------------------* | Returns pointer to malloc'ed PKWARE extra field with file attributes. ************** *** 270,276 /*----------------------* | vms_get_attributes() | ! *----------------------* | Returns pointer to malloc'ed PKWARE extra field with file attributes. | File must be open already by vms_open() */ --- 277,283 ----- /*--------------------------* | vms_get_attributes() | ! *--------------------------* | Returns pointer to malloc'ed PKWARE extra field with file attributes. | File must be open already by vms_open() */ ************** *** 282,287 byte *p,*b; struct PK_header *h; int l; l = PK_HEADER_SIZE+sizeof(ctx->PKi); if(ctx->acllen > 0) --- 289,311 ----- byte *p,*b; struct PK_header *h; int l; + + /* Free extra fields restored from zipfile */ + if( z->ext ) + { free(z->extra); + z->ext = 0; + if( (byte*)z->extra != (byte*)z->cextra && z->cext ) + free(z->cextra); + z->cext = 0; + } + + if( z->cext ) + { free(z->cextra); + z->cext = 0; + } + + if( !vms_native ) + return; l = PK_HEADER_SIZE+sizeof(ctx->PKi); if(ctx->acllen > 0)