From 2d35076b3644f84cedad73e0c4890db2b5afbbd0 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 25 Nov 2017 11:00:29 +0100 Subject: [PATCH] Recognizing appended partitions with partition offset 16 --- xorriso/iso_img.c | 12 ++++++++++-- xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/xorriso/iso_img.c b/xorriso/iso_img.c index 2ca00797..ea7dd040 100644 --- a/xorriso/iso_img.c +++ b/xorriso/iso_img.c @@ -1660,7 +1660,7 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso, char *cat_path= ""; struct elto_img_par *et_imgs= NULL; int elto_count= 0; - uint32_t img_blocks= 0, mbr_parts_end= 0; + uint32_t img_blocks= 0, mbr_parts_end= 0, iso_part_blocks; struct FindjoB *job= NULL; struct stat dir_stbuf; IsoImage *image; @@ -1973,6 +1973,14 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso, if(!have_protective_msdos) appended_as_gpt= 0; + iso_part_blocks= img_blocks; + for(mbr_idx = 0; mbr_idx < mbr_count; mbr_idx++) { + if(mbrpts[mbr_idx].start_block == partition_offset * 4) { + iso_part_blocks= mbrpts[mbr_idx].block_count + partition_offset * 4; + break; + } + } + /* Second pass: scan for System Area info */ for(i= 0; i < line_count; i++) { buf[0]= 0; @@ -2061,7 +2069,7 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso, sscanf(contentpt, "%lu 0x%lx 0x%lx %lu %lu", &partno, &part_status, &part_type, &start_block, &num_blocks); if(num_blocks > 0 && part_type != 0x00 && part_type != 0xee && - (img_blocks <= start_block || + (iso_part_blocks <= start_block || (have_protective_msdos && img_blocks == mbr_parts_end && partno > 1))) { if(!appended_as_gpt) { diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 5a9d919d..ffd89566 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2017.11.17.143122" +#define Xorriso_timestamP "2017.11.25.095955"