equal
deleted
inserted
replaced
510 jzcell *entries; |
510 jzcell *entries; |
511 jint *table; |
511 jint *table; |
512 |
512 |
513 /* Clear previous zip error */ |
513 /* Clear previous zip error */ |
514 zip->msg = NULL; |
514 zip->msg = NULL; |
515 |
|
516 /* Get position of END header */ |
515 /* Get position of END header */ |
517 if ((endpos = findEND(zip, endbuf)) == -1) |
516 if ((endpos = findEND(zip, endbuf)) == -1) |
518 return -1; /* no END header or system error */ |
517 return -1; /* no END header or system error */ |
519 |
518 |
520 if (endpos == 0) return 0; /* only END header present */ |
519 if (endpos == 0) return 0; /* only END header present */ |
521 |
520 |
522 freeCEN(zip); |
521 freeCEN(zip); |
523 |
|
524 /* Get position and length of central directory */ |
522 /* Get position and length of central directory */ |
525 cenlen = ENDSIZ(endbuf); |
523 cenlen = ENDSIZ(endbuf); |
526 cenoff = ENDOFF(endbuf); |
524 cenoff = ENDOFF(endbuf); |
527 total = ENDTOT(endbuf); |
525 total = ENDTOT(endbuf); |
528 if (cenlen == ZIP64_MAGICVAL || cenoff == ZIP64_MAGICVAL || |
526 if (cenlen == ZIP64_MAGICVAL || cenoff == ZIP64_MAGICVAL || |
933 ze->size = CENLEN(cen); |
931 ze->size = CENLEN(cen); |
934 ze->csize = (CENHOW(cen) == STORED) ? 0 : CENSIZ(cen); |
932 ze->csize = (CENHOW(cen) == STORED) ? 0 : CENSIZ(cen); |
935 ze->crc = CENCRC(cen); |
933 ze->crc = CENCRC(cen); |
936 locoff = CENOFF(cen); |
934 locoff = CENOFF(cen); |
937 ze->pos = -(zip->locpos + locoff); |
935 ze->pos = -(zip->locpos + locoff); |
|
936 ze->flag = CENFLG(cen); |
938 |
937 |
939 if ((ze->name = malloc(nlen + 1)) == NULL) goto Catch; |
938 if ((ze->name = malloc(nlen + 1)) == NULL) goto Catch; |
940 memcpy(ze->name, cen + CENHDR, nlen); |
939 memcpy(ze->name, cen + CENHDR, nlen); |
941 ze->name[nlen] = '\0'; |
940 ze->name[nlen] = '\0'; |
942 |
941 |