From 74cb92535dce549b57d8772017c41e7d5de4eddc Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 9 Jul 2008 06:08:03 +0000 Subject: [PATCH] Fixed bug with -as mkisofs -x and pattern expansion --- libisoburn/trunk/xorriso/xorriso.c | 45 +++++++++++++++++++----------- libisoburn/trunk/xorriso/xorriso.h | 3 ++ 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/libisoburn/trunk/xorriso/xorriso.c b/libisoburn/trunk/xorriso/xorriso.c index fccd3e71..161e2096 100644 --- a/libisoburn/trunk/xorriso/xorriso.c +++ b/libisoburn/trunk/xorriso/xorriso.c @@ -7270,13 +7270,27 @@ no_volunteer:; strncpy(speed, cpt, 79); speed[79]= 0; } else if(strcmp(argv[i], "-multi")==0) { + +/* >>> MULTI : allow -multi */ + sprintf(xorriso->info_text, "-as %s: Option -multi not supported.", whom); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } else if(strcmp(argv[i], "-msinfo")==0) { + +/* >>> MULTI : allow -msinfo */ + sprintf(xorriso->info_text, "-as %s: Option -msinfo not supported.",whom); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; + + +/* >>> MULTI : allow --grow_overwriteable_iso */ + +/* >>> MULTI : allow write_start_address= */ +/* >>> MULTI : combine write_start_address=32 with --grow_overwriteable_iso */ +/* >>> MULTI : ??? how about cdrskin. shouldn't it combine too ? */ + } else if(strcmp(argv[i], "--devices")==0) { do_scanbus= 2; } else if(strcmp(argv[i], "-scanbus")==0) { @@ -7427,6 +7441,9 @@ no_volunteer:; goto ex; } if(track_source[0]) { + +/* >>> MULTI : do not close if -multi */ + xorriso->do_close= 1; ret= Xorriso_burn_track(xorriso, track_source, 0); aq_ret= Xorriso_reaquire_outdev(xorriso, 2*(ret>0)); @@ -7458,7 +7475,7 @@ ex:; int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, int argc, char **argv, int flag) { - int ret, i, k, was_path= 0, was_other_option= 0, mem_graft_points; + int ret, i, k, was_path= 0, was_other_option= 0, mem_graft_points, mem; int do_print_size= 0, idx_offset= 0, fd, idx; char sfe[5*SfileadrL], adr[SfileadrL+8], ra_text[80], pathspec[2*SfileadrL]; char *ept, *add_pt, eff_path[SfileadrL], indev[SfileadrL+8], msc[80], *cpt; @@ -7506,15 +7523,6 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, strcpy(ra_text, xorriso->report_about_text); -#ifdef NIX - /* <<< MULTI : */ - if(xorriso->in_drive_handle != NULL) { - ret= Xorriso_option_dev(xorriso, "", 1); /* give up indev */ - if(ret!=1) - return(ret); - } -#endif - adr[0]= indev[0]= msc[0]= 0; for(i= 0; i=argc) goto not_enough_args; i++; - indev[0]= 0; - ret= Xorriso_libburn_adr(xorriso, argv[i], sfe, 0); - if(ret<=0) - strcpy(indev, "stdio:"); + strcpy(indev, "stdio:"); if(Sfile_str(indev+strlen(indev), argv[i], 0)<=0) {ret= -1; goto ex;} } else if(strcmp(argv[i], "-C")==0 || @@ -7615,7 +7620,7 @@ illegal_c:; sfe[cpt-msc]= 0; if(strcmp(sfe, "16")==0) /* growisofs uses 16 to avoid a bug in mkisofs */ strcpy(sfe, "0"); - if(xorriso->in_drive_handle!=NULL) { + if(xorriso->in_drive_handle!=NULL && indev[0]) { /* give up indev before setting the load address */ ret= Xorriso_option_dev(xorriso, "", 1); if(ret<=0) @@ -7717,18 +7722,24 @@ not_enough_args:; if(i+1>=argc) goto not_enough_args; i++; + mem= xorriso->do_disk_pattern; + xorriso->do_disk_pattern= 1; if(strchr(argv[i], '/')!=NULL) { idx= i; ret= Xorriso_option_not_paths(xorriso, i+1, argv, &idx, 0); } else ret= Xorriso_option_not_leaf(xorriso, argv[i], 0); + xorriso->do_disk_pattern= mem; if(ret<=0) goto ex; } else if(strcmp(argv[i], "-exclude-list")==0) { if(i+1>=argc) goto not_enough_args; i++; - ret= Xorriso_option_not_leaf(xorriso, argv[i], 0); + mem= xorriso->do_disk_pattern; + xorriso->do_disk_pattern= 1; + ret= Xorriso_option_not_list(xorriso, argv[i], 0); + xorriso->do_disk_pattern= mem; if(ret<=0) goto ex; } else if(strcmp(argv[i], "-v")==0 || strcmp(argv[i], "-quiet")==0) { @@ -10956,7 +10967,7 @@ int Xorriso_option_not_paths(struct XorrisO *xorriso, int argc, char **argv, end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, - xorriso->do_disk_pattern==1); + (xorriso->do_disk_pattern==1) | 2); if(end_idx<=0) return(end_idx); num_descr= end_idx - *idx; diff --git a/libisoburn/trunk/xorriso/xorriso.h b/libisoburn/trunk/xorriso/xorriso.h index 41c69652..603cdb92 100644 --- a/libisoburn/trunk/xorriso/xorriso.h +++ b/libisoburn/trunk/xorriso/xorriso.h @@ -407,6 +407,9 @@ int Xorriso_option_no_rc(struct XorrisO *xorriso, int flag); /* Option -not_leaf */ int Xorriso_option_not_leaf(struct XorrisO *xorriso, char *pattern, int flag); +/* Option -not_list */ +int Xorriso_option_not_list(struct XorrisO *xorriso, char *adr, int flag); + /* Option -not_paths */ int Xorriso_option_not_paths(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag);