From 4b05b4523728c118adcc71dde84d0439ba6a541b Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 13 Apr 2014 07:19:37 +0000 Subject: [PATCH] Adapted -report_system_area to changed output format of libisofs --- libisoburn/trunk/xorriso/iso_img.c | 26 ++++++++------------ libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/libisoburn/trunk/xorriso/iso_img.c b/libisoburn/trunk/xorriso/iso_img.c index 59a211ea..415eeac5 100644 --- a/libisoburn/trunk/xorriso/iso_img.c +++ b/libisoburn/trunk/xorriso/iso_img.c @@ -1425,17 +1425,17 @@ ex:; int Xorriso_report_system_area(struct XorrisO *xorriso, char *form, int flag) { - int ret; - char *text = NULL, *cpt, *npt; + int ret, line_count, i; + char **lines = NULL; IsoImage *image; if(strcmp(form, "help") == 0) { - ret= iso_image_report_system_area(NULL, &text, 1); + ret= iso_image_report_system_area(NULL, &lines, &line_count, 1); } else if(strcmp(form, "") == 0 || strcmp(form, "plain") == 0) { ret= Xorriso_get_volume(xorriso, &image, 0); if(ret <= 0) goto ex; - ret= iso_image_report_system_area(image, &text, 0); + ret= iso_image_report_system_area(image, &lines, &line_count, 0); } else if(strncmp(form, "gpt_crc_of:", 11) == 0) { ret = Xorriso_gpt_crc(xorriso, form + 11, 0); goto ex; @@ -1448,31 +1448,25 @@ int Xorriso_report_system_area(struct XorrisO *xorriso, char *form, int flag) } if(ret < 0) goto ex; - if(text == NULL || ret == 0) { + if(lines == 0 || ret == 0) { strcpy(xorriso->info_text, "No System Area was loaded"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 2; goto ex; } - if(text[0] == 0) { + if(line_count == 0) { strcpy(xorriso->info_text, "System Area only contains 0-bytes"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 2; goto ex; } - for(npt= cpt= text; npt != NULL; cpt= npt + 1) { - npt= strchr(cpt, '\n'); - if(npt == NULL) - strcpy(xorriso->result_line, cpt); - else { - strncpy(xorriso->result_line, cpt, npt - cpt + 1); - xorriso->result_line[npt - cpt + 1]= 0; - } + for(i = 0; i < line_count ; i++) { + sprintf(xorriso->result_line, "%s\n", lines[i]); Xorriso_result(xorriso,0); } ret= 1; ex:; - if(text != NULL) - free(text); + if(lines != NULL) + iso_image_report_system_area(NULL, &lines, &line_count, 1 << 15); return(ret); } diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 171bf8d2..b90d3295 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2014.04.12.130150" +#define Xorriso_timestamP "2014.04.13.071908"