Allowing double dashes with all long options

This commit is contained in:
Thomas Schmitt 2011-04-01 13:31:00 +00:00
parent 82971d918e
commit 570d5a0e22
2 changed files with 245 additions and 209 deletions

View File

@ -617,7 +617,7 @@ int Xorriso_genisofs_count_args(struct XorrisO *xorriso, int argc, char **argv,
/* @param flag bit0= do not report eventual ignore decision
*/
int Xorriso_genisofs_ignore(struct XorrisO *xorriso, char *whom,
char **argv, int *i, int flag)
char *argpt, int *i, int flag)
{
/* mkisofs 2.01 options which are not scheduled for implementation, yet */
static char ignored_arg0_options[][41]= {
@ -633,23 +633,22 @@ int Xorriso_genisofs_ignore(struct XorrisO *xorriso, char *whom,
"-check-session", "-hide-hfs", "-hide-hfs-list",
"-table-name", "-volset-seqno", "-volset-size",
""
}; /* "-root", "-old-root", */
int k, idx_offset= 0;
};
int k;
char sfe[5*SfileadrL];
for(k=0;ignored_arg0_options[k][0]!=0;k++)
if(strcmp(argv[*i],ignored_arg0_options[k])==0)
if(strcmp(argpt,ignored_arg0_options[k])==0)
goto no_volunteer;
for(k=0;ignored_arg1_options[k][0]!=0;k++)
if(strcmp(argv[*i],ignored_arg1_options[k])==0) {
if(strcmp(argpt,ignored_arg1_options[k])==0) {
(*i)++;
idx_offset= -1;
goto no_volunteer;
}
}
return(0);
no_volunteer:;
sprintf(xorriso->info_text, "-as %s: Ignored option %s",
whom, Text_shellsafe(argv[(*i)+idx_offset], sfe, 0));
whom, Text_shellsafe(argpt, sfe, 0));
if(!(flag & 1))
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
return(1);
@ -891,6 +890,27 @@ ex:;
}
/* Strip surplus dash from known single-dash long options */
int Xorriso_genisofs_strip_dash(struct XorrisO *xorriso, char *arg_in,
char **arg_out, int flag)
{
int ret, count;
char *argv[1];
*arg_out= arg_in;
if(strlen(arg_in) < 4)
return(1);
if(arg_in[0] != '-' || arg_in[1] != '-' || arg_in[2] == '-')
return(1);
argv[0]= arg_in + 1;
ret= Xorriso_genisofs_count_args(xorriso, 1, argv, &count, 0);
if(ret > 0)
*arg_out= arg_in + 1;
return(1);
}
/* micro emulation of mkisofs */
int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
int argc, char **argv, int flag)
@ -907,7 +927,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
int *delay_opt_list= NULL, delay_opt_count= 0;
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;
char old_root[SfileadrL];
char old_root[SfileadrL], *argpt, *hargv[1];
char *boot_path, partno_text[8], *iso_rr_pt, *disk_pt, *rpt, *wpt;
char *rm_merge_args[3];
@ -934,10 +954,13 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
with_cat_path= -1;
adr[0]= indev[0]= msc[0]= old_root[0]= 0;
for(i= 0; i<argc; i++) {
ret= Xorriso_genisofs_ignore(xorriso, whom, argv, &i, 1);
ret= Xorriso_genisofs_strip_dash(xorriso, argv[i], &argpt, 0);
if(ret <= 0)
goto ex;
ret= Xorriso_genisofs_ignore(xorriso, whom, argpt, &i, 1);
if(ret == 1)
continue;
if(strcmp(argv[i], "-version")==0) {
if(strcmp(argpt, "-version")==0) {
sprintf(xorriso->result_line,
"mkisofs 2.01-Emulation Copyright (C) 2011 see libburnia-project.org xorriso\n"
);
@ -949,7 +972,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
fsync(fd);
Xorriso_option_version(xorriso, 0);
} else if(strcmp(argv[i], "-o")==0 || strcmp(argv[i], "-output")==0) {
} else if(strcmp(argpt, "-o")==0 || strcmp(argpt, "-output")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -958,8 +981,8 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
strcpy(adr, "stdio:");
if(Sfile_str(adr+strlen(adr), argv[i], 0)<=0)
{ret= -1; goto ex;}
} else if(strcmp(argv[i], "-M")==0 || strcmp(argv[i], "-dev")==0 ||
strcmp(argv[i], "-prev-session")==0) {
} else if(strcmp(argpt, "-M")==0 || strcmp(argpt, "-dev")==0 ||
strcmp(argpt, "-prev-session")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -967,24 +990,24 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
strcpy(indev, "stdio:");
if(Sfile_str(indev+strlen(indev), argv[i], 0)<=0)
{ret= -1; goto ex;}
} else if(strcmp(argv[i], "-C")==0 ||
strcmp(argv[i], "-cdrecord-params")==0) {
} else if(strcmp(argpt, "-C")==0 ||
strcmp(argpt, "-cdrecord-params")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
strncpy(msc, argv[i], sizeof(msc)-1);
msc[sizeof(msc)-1]= 0;
} else if(strcmp(argv[i], "-help")==0) {
} else if(strcmp(argpt, "-help")==0) {
Xorriso_genisofs_help(xorriso, 0);
} else if(strcmp(argv[i], "-v")==0 || strcmp(argv[i], "-verbose")==0) {
} else if(strcmp(argpt, "-v")==0 || strcmp(argpt, "-verbose")==0) {
strcpy(ra_text, "UPDATE");
} else if(strcmp(argv[i], "-quiet")==0) {
} else if(strcmp(argpt, "-quiet")==0) {
strcpy(ra_text, "SORRY");
} else if(strcmp(argv[i], "-f")==0 || strcmp(argv[i], "-follow-links")==0) {
} else if(strcmp(argpt, "-f")==0 || strcmp(argpt, "-follow-links")==0) {
ret= Xorriso_option_follow(xorriso, "on", 0);
if(ret<=0)
goto problem_handler_1;
} else if(strcmp(argv[i], "-iso-level")==0) {
} else if(strcmp(argpt, "-iso-level")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -1005,7 +1028,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
goto problem_handler_1;
}
} else if(strcmp(argv[i], "-input-charset")==0) {
} else if(strcmp(argpt, "-input-charset")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -1016,7 +1039,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
ret= Xorriso_option_charset(xorriso, argv[i], 4);
if(ret <= 0)
goto problem_handler_1;
} else if(strcmp(argv[i], "-output-charset")==0) {
} else if(strcmp(argpt, "-output-charset")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -1028,25 +1051,25 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
if(ret <= 0)
goto problem_handler_1;
} else if(strcmp(argv[i], "-hide") == 0 ||
strcmp(argv[i], "-hide-list") == 0 ||
strcmp(argv[i], "-hide-joliet") == 0 ||
strcmp(argv[i], "-hide-joliet-list") == 0) {
} else if(strcmp(argpt, "-hide") == 0 ||
strcmp(argpt, "-hide-list") == 0 ||
strcmp(argpt, "-hide-joliet") == 0 ||
strcmp(argpt, "-hide-joliet-list") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
if(strcmp(argv[i - 1], "-hide") == 0)
if(strcmp(argpt, "-hide") == 0)
ret= Xorriso_genisofs_hide(xorriso, whom, argv[i], 1, 0);
else if(strcmp(argv[i - 1], "-hide-list") == 0)
else if(strcmp(argpt, "-hide-list") == 0)
ret= Xorriso_genisofs_hide_list(xorriso, whom, argv[i], 1, 0);
else if(strcmp(argv[i - 1], "-hide-joliet") == 0)
else if(strcmp(argpt, "-hide-joliet") == 0)
ret= Xorriso_genisofs_hide(xorriso, whom, argv[i], 2, 0);
else if(strcmp(argv[i - 1], "-hide-joliet-list") == 0)
else if(strcmp(argpt, "-hide-joliet-list") == 0)
ret= Xorriso_genisofs_hide_list(xorriso, whom, argv[i], 2, 0);
if(ret <= 0)
goto problem_handler_1;
} else if(strcmp(argv[i], "-root") == 0) {
} else if(strcmp(argpt, "-root") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -1057,7 +1080,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
strcpy(xorriso->wdi, eff_path);
root_seen= 1;
} else if(strcmp(argv[i], "-old-root") == 0) {
} else if(strcmp(argpt, "-old-root") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -1066,52 +1089,53 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
if(Sfile_str(old_root, argv[i], argv[i][0] != '/') <= 0)
{ret= -1; goto ex;}
} else if(strcmp(argv[i], "--old-root-no-md5")==0) {
} else if(strcmp(argpt, "--old-root-no-md5")==0) {
old_root_md5= 0;
} else if(strcmp(argv[i], "--old-root-devno")==0) {
} else if(strcmp(argpt, "--old-root-devno")==0) {
old_root_dev= 1;
} else if(strcmp(argv[i], "--old-root-no-ino")==0) {
} else if(strcmp(argpt, "--old-root-no-ino")==0) {
old_root_ino= 0;
} else if(strcmp(argv[i], "--hardlinks")==0) {
} else if(strcmp(argpt, "--hardlinks")==0) {
Xorriso_option_hardlinks(xorriso, "on", 0);
} else if(strcmp(argv[i], "--acl")==0) {
} else if(strcmp(argpt, "--acl")==0) {
Xorriso_option_acl(xorriso, "on", 0);
} else if(strcmp(argv[i], "--xattr")==0) {
} else if(strcmp(argpt, "--xattr")==0) {
Xorriso_option_xattr(xorriso, "on", 0);
} else if(strcmp(argv[i], "--md5")==0) {
} else if(strcmp(argpt, "--md5")==0) {
Xorriso_option_md5(xorriso, "on", 0);
} else if(strcmp(argv[i], "--scdbackup_tag")==0) {
} else if(strcmp(argpt, "--scdbackup_tag")==0) {
if(i + 2 >= argc)
goto not_enough_args;
i+= 2;
ret= Xorriso_option_scdbackup_tag(xorriso, argv[i-1], argv[i], 0);
if(ret <= 0)
goto problem_handler_1;
} else if(strcmp(argv[i], "--for_backup")==0) {
} else if(strcmp(argpt, "--for_backup")==0) {
Xorriso_option_hardlinks(xorriso, "on", 0);
Xorriso_option_acl(xorriso, "on", 0);
Xorriso_option_xattr(xorriso, "on", 0);
Xorriso_option_md5(xorriso, "on", 0);
} else if(strcmp(argv[i], "-z")==0 ||
strcmp(argv[i], "-transparent-compression")==0) {
} else if(strcmp(argpt, "-z")==0 ||
strcmp(argpt, "-transparent-compression")==0) {
Xorriso_option_zisofs(xorriso, "by_magic=on", 0);
} else if(strcmp(argv[i], "--stdio_sync")==0) {
} else if(strcmp(argpt, "--stdio_sync")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
Xorriso_option_stdio_sync(xorriso, argv[i], 0);
} else if(strcmp(argv[i], "-disallow_dir_id_ext")==0) {
} else if(strcmp(argpt, "-disallow_dir_id_ext")==0) {
allow_dir_id_ext= 0;
} else if(strcmp(argv[i], "--emul-toc")==0) {
} else if(strcmp(argpt, "--emul-toc")==0) {
with_emul_toc= 1;
xorriso->no_emul_toc&= ~1;
} else if(strcmp(argv[i], "--no-emul-toc")==0) {
} else if(strcmp(argpt, "--no-emul-toc")==0) {
with_emul_toc= 0;
xorriso->no_emul_toc|= 1;
} else
was_other_option= 1;
ret= Xorriso_genisofs_count_args(xorriso, argc - i, argv + i, &count, 0);
hargv[0]= argpt;
ret= Xorriso_genisofs_count_args(xorriso, argc - i, hargv, &count, 0);
if(ret > 0)
i+= count; /* skip eventual arguments of known option */
continue; /* regular bottom of loop */
@ -1225,27 +1249,30 @@ illegal_c:;
sprintf(xorriso->info_text, "-as %s: %s",
whom, Text_shellsafe(argv[i], sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
ret= Xorriso_genisofs_ignore(xorriso, whom, argv, &i, 0);
ret= Xorriso_genisofs_strip_dash(xorriso, argv[i], &argpt, 0);
if(ret <= 0)
goto ex;
ret= Xorriso_genisofs_ignore(xorriso, whom, argpt, &i, 0);
if(ret == 1)
continue;
if(strcmp(argv[i], "-version")==0) {
if(strcmp(argpt, "-version")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-R")==0 || strcmp(argv[i], "-rock")==0) {
} else if(strcmp(argpt, "-R")==0 || strcmp(argpt, "-rock")==0) {
/* ok */;
} else if(strcmp(argv[i], "-r")==0 || strcmp(argv[i], "-rational-rock")==0){
} else if(strcmp(argpt, "-r")==0 || strcmp(argpt, "-rational-rock")==0){
lower_r= 1;
} else if(strcmp(argv[i], "-J")==0 || strcmp(argv[i], "-joliet")==0) {
} else if(strcmp(argpt, "-J")==0 || strcmp(argpt, "-joliet")==0) {
xorriso->do_joliet= 1;
} else if(strcmp(argv[i], "-joliet-long")==0) {
} else if(strcmp(argpt, "-joliet-long")==0) {
ret= Xorriso_option_compliance(xorriso,
"joliet_long_paths:joliet_long_names", 0);
if(ret<=0)
goto problem_handler_2;
} else if(strcmp(argv[i], "-graft-points")==0) {
} else if(strcmp(argpt, "-graft-points")==0) {
xorriso->allow_graft_points= 1;
} else if(strcmp(argv[i], "-path-list")==0 ||
strcmp(argv[i], "--quoted_path_list")==0) {
} else if(strcmp(argpt, "-path-list")==0 ||
strcmp(argpt, "--quoted_path_list")==0) {
if(i+1>=argc) {
not_enough_args:;
sprintf(xorriso->info_text, "-as %s: Not enough arguments to option %s",
@ -1257,67 +1284,67 @@ not_enough_args:;
was_path= 1;
xorriso->pacifier_style= 1;
ret= Xorriso_option_path_list(xorriso, argv[i],
(strcmp(argv[i-1], "--quoted_path_list")==0));
(strcmp(argpt, "--quoted_path_list")==0));
if(ret<=0)
goto problem_handler_2;
} else if(strcmp(argv[i], "-f")==0 || strcmp(argv[i], "-follow-links")==0) {
} else if(strcmp(argpt, "-f")==0 || strcmp(argpt, "-follow-links")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-pad")==0) {
} else if(strcmp(argpt, "-pad")==0) {
xorriso->padding= 300*1024;
} else if(strcmp(argv[i], "-no-pad")==0) {
} else if(strcmp(argpt, "-no-pad")==0) {
xorriso->padding= 0;
} else if(strcmp(argv[i], "-print-size")==0) {
} else if(strcmp(argpt, "-print-size")==0) {
do_print_size= 1;
} else if(strcmp(argv[i], "-o")==0 || strcmp(argv[i], "-output") == 0) {
} else if(strcmp(argpt, "-o")==0 || strcmp(argpt, "-output") == 0) {
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-M")==0 || strcmp(argv[i], "-dev")==0 ||
strcmp(argv[i], "-prev-session")==0) {
} else if(strcmp(argpt, "-M")==0 || strcmp(argpt, "-dev")==0 ||
strcmp(argpt, "-prev-session")==0) {
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-C")==0 ||
strcmp(argv[i], "-cdrecord-params")==0) {
} else if(strcmp(argpt, "-C")==0 ||
strcmp(argpt, "-cdrecord-params")==0) {
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-help")==0) {
} else if(strcmp(argpt, "-help")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-V")==0 || strcmp(argv[i], "-volid")==0 ||
strcmp(argv[i], "-volset")==0 ||
strcmp(argv[i], "-p")==0 || strcmp(argv[i], "-preparer")==0 ||
strcmp(argv[i], "-P")==0 || strcmp(argv[i], "-publisher")==0 ||
strcmp(argv[i], "-A")==0 || strcmp(argv[i], "-appid")==0 ||
strcmp(argv[i], "-sysid")==0 ||
strcmp(argv[i], "-biblio")==0 ||
strcmp(argv[i], "-copyright")==0 ||
strcmp(argv[i], "-abstract")==0 ) {
} else if(strcmp(argpt, "-V")==0 || strcmp(argpt, "-volid")==0 ||
strcmp(argpt, "-volset")==0 ||
strcmp(argpt, "-p")==0 || strcmp(argpt, "-preparer")==0 ||
strcmp(argpt, "-P")==0 || strcmp(argpt, "-publisher")==0 ||
strcmp(argpt, "-A")==0 || strcmp(argpt, "-appid")==0 ||
strcmp(argpt, "-sysid")==0 ||
strcmp(argpt, "-biblio")==0 ||
strcmp(argpt, "-copyright")==0 ||
strcmp(argpt, "-abstract")==0 ) {
if(i+1>=argc)
goto not_enough_args;
i++;
ret= 1;
if(strcmp(argv[i - 1], "-V")==0 || strcmp(argv[i - 1], "-volid")==0)
if(strcmp(argpt, "-V")==0 || strcmp(argpt, "-volid")==0)
ret= Xorriso_option_volid(xorriso, argv[i], 0);
else if(strcmp(argv[i - 1], "-volset")==0)
else if(strcmp(argpt, "-volset")==0)
ret= Xorriso_option_volset_id(xorriso, argv[i], 0);
else if(strcmp(argv[i - 1], "-p")==0 ||
strcmp(argv[i - 1], "-preparer")==0)
else if(strcmp(argpt, "-p")==0 ||
strcmp(argpt, "-preparer")==0)
ret= Xorriso_option_preparer_id(xorriso, argv[i], 0);
else if(strcmp(argv[i - 1], "-P")==0 ||
strcmp(argv[i - 1], "-publisher")==0)
else if(strcmp(argpt, "-P")==0 ||
strcmp(argpt, "-publisher")==0)
ret= Xorriso_option_publisher(xorriso, argv[i], 0);
else if(strcmp(argv[i - 1], "-A")==0 || strcmp(argv[i - 1], "-appid")==0)
else if(strcmp(argpt, "-A")==0 || strcmp(argpt, "-appid")==0)
ret= Xorriso_option_application_id(xorriso, argv[i], 0);
else if(strcmp(argv[i - 1], "-sysid")==0)
else if(strcmp(argpt, "-sysid")==0)
ret= Xorriso_option_system_id(xorriso, argv[i], 0);
else if(strcmp(argv[i - 1], "-biblio")==0)
else if(strcmp(argpt, "-biblio")==0)
ret= Xorriso_option_biblio_file(xorriso, argv[i], 0);
else if(strcmp(argv[i - 1], "-copyright")==0)
else if(strcmp(argpt, "-copyright")==0)
ret= Xorriso_option_copyright_file(xorriso, argv[i], 0);
else if(strcmp(argv[i - 1], "-abstract")==0)
else if(strcmp(argpt, "-abstract")==0)
ret= Xorriso_option_abstract_file(xorriso, argv[i], 0);
if(ret<=0)
goto problem_handler_2;
} else if(strcmp(argv[i], "-m")==0 || strcmp(argv[i], "-exclude")==0 ||
strcmp(argv[i], "-x")==0 || strcmp(argv[i], "-old-exclude")==0) {
} else if(strcmp(argpt, "-m")==0 || strcmp(argpt, "-exclude")==0 ||
strcmp(argpt, "-x")==0 || strcmp(argpt, "-old-exclude")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -1331,7 +1358,7 @@ not_enough_args:;
xorriso->do_disk_pattern= mem;
if(ret<=0)
goto problem_handler_2;
} else if(strcmp(argv[i], "-exclude-list")==0) {
} else if(strcmp(argpt, "-exclude-list")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -1341,76 +1368,80 @@ not_enough_args:;
xorriso->do_disk_pattern= mem;
if(ret<=0)
goto problem_handler_2;
} else if(strcmp(argv[i], "-v")==0 || strcmp(argv[i], "-verbose")==0 ||
strcmp(argv[i], "-quiet")==0) {
} else if(strcmp(argpt, "-v")==0 || strcmp(argpt, "-verbose")==0 ||
strcmp(argpt, "-quiet")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-iso-level")==0) {
} else if(strcmp(argpt, "-iso-level")==0) {
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-no-emul-boot")==0 ||
strcmp(argv[i], "-hard-disk-boot")==0 ||
strcmp(argv[i], "-boot-info-table")==0 ||
strncmp(argv[i], "isolinux_mbr=", 13)==0 ||
strcmp(argv[i], "-eltorito-alt-boot")==0 ||
strcmp(argv[i], "--protective-msdos-label")==0 ||
strcmp(argv[i], "--boot-catalog-hide")==0) {
} else if(strcmp(argpt, "-no-emul-boot")==0 ||
strcmp(argpt, "-hard-disk-boot")==0 ||
strcmp(argpt, "-boot-info-table")==0 ||
strncmp(argpt, "isolinux_mbr=", 13)==0 ||
strcmp(argpt, "-eltorito-alt-boot")==0 ||
strcmp(argpt, "--protective-msdos-label")==0 ||
strcmp(argpt, "--boot-catalog-hide")==0) {
delay_opt_list[delay_opt_count++]= i;
} else if(strcmp(argv[i], "-b") == 0 ||
strcmp(argv[i], "-eltorito-boot") == 0 ||
strcmp(argv[i], "--efi-boot") == 0 ||
strcmp(argv[i], "-e") == 0 ||
strcmp(argv[i], "-mips-boot") == 0 ||
strcmp(argv[i], "-mipsel-boot") == 0 ||
strcmp(argv[i], "-c") == 0 ||
strcmp(argv[i], "-eltorito-catalog") == 0 ||
strcmp(argv[i], "-boot-load-size") == 0 ||
strcmp(argv[i], "--embedded-boot")==0 ||
strcmp(argv[i], "-generic-boot")==0 ||
strcmp(argv[i], "-G") == 0 ||
strcmp(argv[i], "-partition_offset") == 0 ||
strcmp(argv[i], "-partition_hd_cyl") == 0 ||
strcmp(argv[i], "-partition_sec_hd") == 0 ||
strcmp(argv[i], "-partition_cyl_align") == 0 ||
strcmp(argv[i], "-isohybrid-mbr")==0) {
if(argv[i] != argpt)
delay_opt_list[delay_opt_count - 1]|= 1<<31;
} else if(strcmp(argpt, "-b") == 0 ||
strcmp(argpt, "-eltorito-boot") == 0 ||
strcmp(argpt, "--efi-boot") == 0 ||
strcmp(argpt, "-e") == 0 ||
strcmp(argpt, "-mips-boot") == 0 ||
strcmp(argpt, "-mipsel-boot") == 0 ||
strcmp(argpt, "-c") == 0 ||
strcmp(argpt, "-eltorito-catalog") == 0 ||
strcmp(argpt, "-boot-load-size") == 0 ||
strcmp(argpt, "--embedded-boot")==0 ||
strcmp(argpt, "-generic-boot")==0 ||
strcmp(argpt, "-G") == 0 ||
strcmp(argpt, "-partition_offset") == 0 ||
strcmp(argpt, "-partition_hd_cyl") == 0 ||
strcmp(argpt, "-partition_sec_hd") == 0 ||
strcmp(argpt, "-partition_cyl_align") == 0 ||
strcmp(argpt, "-isohybrid-mbr")==0) {
if(i+1>=argc)
goto not_enough_args;
delay_opt_list[delay_opt_count++]= i;
if(argv[i] != argpt)
delay_opt_list[delay_opt_count - 1]|= 1<<31;
i++;
} else if(strncmp(argv[i], "--modification-date=", 20)==0) {
ret= Xorriso_option_volume_date(xorriso, "uuid", argv[i] + 20, 0);
} else if(strncmp(argpt, "--modification-date=", 20)==0) {
ret= Xorriso_option_volume_date(xorriso, "uuid", argpt + 20, 0);
if(ret <= 0)
goto problem_handler_2;
} else if(strcmp(argv[i], "-input-charset")==0) {
} else if(strcmp(argpt, "-input-charset")==0) {
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-output-charset")==0) {
} else if(strcmp(argpt, "-output-charset")==0) {
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "--hardlinks")==0 ||
strcmp(argv[i], "--acl")==0 ||
strcmp(argv[i], "--xattr")==0 ||
strcmp(argv[i], "--md5")==0 ||
strcmp(argv[i], "--for_backup")==0) {
} else if(strcmp(argpt, "--hardlinks")==0 ||
strcmp(argpt, "--acl")==0 ||
strcmp(argpt, "--xattr")==0 ||
strcmp(argpt, "--md5")==0 ||
strcmp(argpt, "--for_backup")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "--scdbackup_tag")==0) {
} else if(strcmp(argpt, "--scdbackup_tag")==0) {
/* was already handled in first argument scan */;
i+= 2;
} else if(strcmp(argv[i], "--sort-weight")==0) {
} else if(strcmp(argpt, "--sort-weight")==0) {
if(i + 2 >= argc)
goto not_enough_args;
i+= 2;
/* memorize for find runs after pathspecs have been added */
weight_list[weight_count++]= i - 2;
} else if(strcmp(argv[i], "-z")==0 ||
strcmp(argv[i], "-transparent-compression")==0) {
} else if(strcmp(argpt, "-z")==0 ||
strcmp(argpt, "-transparent-compression")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-U") == 0 ||
strcmp(argv[i], "-untranslated-filenames") == 0) {
} else if(strcmp(argpt, "-U") == 0 ||
strcmp(argpt, "-untranslated-filenames") == 0) {
Xorriso_relax_compliance(xorriso,
"no_force_dots:long_paths:long_names:omit_version:full_ascii:lowercase", 0);
} else if(strcmp(argv[i], "-untranslated_name_len") == 0) {
} else if(strcmp(argpt, "-untranslated_name_len") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -1418,38 +1449,38 @@ not_enough_args:;
ret= Xorriso_relax_compliance(xorriso, sfe, 0);
if(ret <= 0)
goto problem_handler_2;
} else if(strcmp(argv[i], "-N") == 0 ||
strcmp(argv[i], "-omit-version-number") == 0) {
} else if(strcmp(argpt, "-N") == 0 ||
strcmp(argpt, "-omit-version-number") == 0) {
Xorriso_relax_compliance(xorriso, "omit_version", 0);
} else if(strcmp(argv[i], "-l") == 0 ||
strcmp(argv[i], "-full-iso9660-filenames") == 0 ||
strcmp(argv[i], "-max-iso9660-filenames") == 0) {
} else if(strcmp(argpt, "-l") == 0 ||
strcmp(argpt, "-full-iso9660-filenames") == 0 ||
strcmp(argpt, "-max-iso9660-filenames") == 0) {
Xorriso_relax_compliance(xorriso, "long_names", 0);
} else if(strcmp(argv[i], "-d") == 0 ||
strcmp(argv[i], "-omit-period") == 0) {
} else if(strcmp(argpt, "-d") == 0 ||
strcmp(argpt, "-omit-period") == 0) {
Xorriso_relax_compliance(xorriso, "no_force_dots", 0);
} else if(strcmp(argv[i], "-allow-lowercase") == 0) {
} else if(strcmp(argpt, "-allow-lowercase") == 0) {
Xorriso_relax_compliance(xorriso, "lowercase", 0);
} else if(strcmp(argv[i], "-hide") == 0 ||
strcmp(argv[i], "-hide-list") == 0 ||
strcmp(argv[i], "-hide-joliet") == 0 ||
strcmp(argv[i], "-hide-joliet-list") == 0) {
} else if(strcmp(argpt, "-hide") == 0 ||
strcmp(argpt, "-hide-list") == 0 ||
strcmp(argpt, "-hide-joliet") == 0 ||
strcmp(argpt, "-hide-joliet-list") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-root") == 0 ||
strcmp(argv[i], "-old-root") == 0) {
} else if(strcmp(argpt, "-root") == 0 ||
strcmp(argpt, "-old-root") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "--old-root-no-md5")==0 ||
strcmp(argv[i], "--old-root-devno")==0 ||
strcmp(argv[i], "--old-root-no-ino")==0) {
} else if(strcmp(argpt, "--old-root-no-md5")==0 ||
strcmp(argpt, "--old-root-devno")==0 ||
strcmp(argpt, "--old-root-no-ino")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-dir-mode") == 0) {
} else if(strcmp(argpt, "-dir-mode") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -1458,7 +1489,7 @@ not_enough_args:;
if(ret<=0)
goto problem_handler_2;
dir_mode= mode_or;
} else if(strcmp(argv[i], "-file-mode") == 0) {
} else if(strcmp(argpt, "-file-mode") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -1467,29 +1498,29 @@ not_enough_args:;
if(ret<=0)
goto problem_handler_2;
file_mode= mode_or;
} else if(strcmp(argv[i], "-jigdo-jigdo") == 0 ||
strcmp(argv[i], "-jigdo-template") == 0 ||
strcmp(argv[i], "-jigdo-min-file-size") == 0 ||
strcmp(argv[i], "-jigdo-exclude") == 0 ||
strcmp(argv[i], "-jigdo-force-md5") == 0 ||
strcmp(argv[i], "-jigdo-map") == 0 ||
strcmp(argv[i], "-jigdo-template-compress") == 0 ||
strcmp(argv[i], "-checksum_algorithm_iso") == 0 ||
strcmp(argv[i], "-checksum_algorithm_template") == 0 ||
strcmp(argv[i], "-md5-list") == 0) {
} else if(strcmp(argpt, "-jigdo-jigdo") == 0 ||
strcmp(argpt, "-jigdo-template") == 0 ||
strcmp(argpt, "-jigdo-min-file-size") == 0 ||
strcmp(argpt, "-jigdo-exclude") == 0 ||
strcmp(argpt, "-jigdo-force-md5") == 0 ||
strcmp(argpt, "-jigdo-map") == 0 ||
strcmp(argpt, "-jigdo-template-compress") == 0 ||
strcmp(argpt, "-checksum_algorithm_iso") == 0 ||
strcmp(argpt, "-checksum_algorithm_template") == 0 ||
strcmp(argpt, "-md5-list") == 0) {
i++;
ret= Xorriso_option_jigdo(xorriso, argv[i - 1], argv[i], 0);
ret= Xorriso_option_jigdo(xorriso, argpt, argv[i], 0);
if(ret <= 0)
goto problem_handler_2;
} else if(strcmp(argv[i], "-append_partition") == 0) {
} else if(strcmp(argpt, "-append_partition") == 0) {
i+= 3;
ret= Xorriso_option_append_partition(xorriso, argv[i - 2], argv[i - 1],
argv[i], 0);
if(ret <= 0)
goto problem_handler_2;
} else if(strcmp(argv[i], "-B") == 0 ||
strcmp(argv[i], "-sparc-boot") == 0) {
} else if(strcmp(argpt, "-B") == 0 ||
strcmp(argpt, "-sparc-boot") == 0) {
i++;
if(strlen(argv[i]) >= SfileadrL)
continue;
@ -1536,32 +1567,33 @@ not_enough_args:;
}
}
} else if(strcmp(argv[i], "-sparc-label") == 0) {
} else if(strcmp(argpt, "-sparc-label") == 0) {
i++;
strncpy(xorriso->ascii_disc_label, argv[i], Xorriso_disc_label_sizE - 1);
xorriso->ascii_disc_label[Xorriso_disc_label_sizE - 1] = 0;
} else if(strcmp(argv[i], "--stdio_sync")==0) {
} else if(strcmp(argpt, "--stdio_sync")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "--emul-toc")==0 ||
strcmp(argv[i], "--no-emul-toc")==0) {
} else if(strcmp(argpt, "--emul-toc")==0 ||
strcmp(argpt, "--no-emul-toc")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "--old-empty")==0) {
} else if(strcmp(argpt, "--old-empty")==0) {
xorriso->do_old_empty= 1;
} else if(strcmp(argv[i], "-disallow_dir_id_ext")==0) {
} else if(strcmp(argpt, "-disallow_dir_id_ext")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "--no_rc")==0) {
} else if(strcmp(argpt, "--no_rc")==0) {
/* was already handled in Xorriso_prescan_args */;
} else if(argv[i][0]=='-' && argv[i][1]!=0) {
ret= Xorriso_genisofs_count_args(xorriso, argc - i, argv + i, &count, 1);
} else if(argpt[0]=='-' && argpt[1]!=0) {
hargv[0]= argpt;
ret= Xorriso_genisofs_count_args(xorriso, argc - i, hargv, &count, 1);
if(ret > 0) {
sprintf(xorriso->info_text, "-as %s: Unsupported option %s",
whom, Text_shellsafe(argv[i], sfe, 0));
@ -1730,19 +1762,23 @@ problem_handler_2:;
/* After all pathspecs are added: perform boot related options */
for(j= 0; j < delay_opt_count; j++) {
i= delay_opt_list[j];
if(strcmp(argv[i], "-no-emul-boot")==0) {
i= delay_opt_list[j] & ~(1 << 31);
if(delay_opt_list[j] & (1 << 31))
argpt= argv[i] + 1;
else
argpt= argv[i];
if(strcmp(argpt, "-no-emul-boot")==0) {
emul_boot= xorriso->boot_image_emul= 0;
} else if(strcmp(argv[i], "-hard-disk-boot")==0) {
} else if(strcmp(argpt, "-hard-disk-boot")==0) {
emul_boot= xorriso->boot_image_emul= 1;
} else if(strcmp(argv[i], "-boot-info-table")==0) {
} else if(strcmp(argpt, "-boot-info-table")==0) {
xorriso->patch_isolinux_image= 1;
} else if(strcmp(argv[i], "-b") == 0 ||
strcmp(argv[i], "-eltorito-boot") == 0 ||
strcmp(argv[i], "--efi-boot") == 0 ||
strcmp(argv[i], "-e") == 0) {
} else if(strcmp(argpt, "-b") == 0 ||
strcmp(argpt, "-eltorito-boot") == 0 ||
strcmp(argpt, "--efi-boot") == 0 ||
strcmp(argpt, "-e") == 0) {
i++;
if(strcmp(argv[i - 1], "--efi-boot") == 0) {
if(strcmp(argpt, "--efi-boot") == 0) {
if(xorriso->boot_image_bin_path[0]) {
ret= Xorriso_genisofs_add_boot(xorriso, whom,
&option_b, &emul_boot, 0);
@ -1755,7 +1791,7 @@ problem_handler_2:;
} else {
boot_path= xorriso->boot_image_bin_path;
if(strcmp(argv[i - 1], "-e") == 0)
if(strcmp(argpt, "-e") == 0)
xorriso->boot_platform_id= 0xef;
else
xorriso->boot_platform_id= 0x00;
@ -1779,8 +1815,8 @@ problem_handler_2:;
}
xorriso->keep_boot_image= 0;
with_boot_image= 1;
} else if(strcmp(argv[i], "-c") == 0 ||
strcmp(argv[i], "-eltorito-catalog") == 0) {
} else if(strcmp(argpt, "-c") == 0 ||
strcmp(argpt, "-eltorito-catalog") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
@ -1793,56 +1829,56 @@ problem_handler_2:;
goto ex;
if(with_cat_path == 0)
with_cat_path= 1;
} else if(strcmp(argv[i], "-boot-load-size") == 0) {
} else if(strcmp(argpt, "-boot-load-size") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
sscanf(argv[i], "%d", &ret);
xorriso->boot_image_load_size= ret * 512;
} else if(strncmp(argv[i], "isolinux_mbr=", 13)==0) {
sprintf(sfe, "isohybrid=%s", argv[i] + 13);
} else if(strncmp(argpt, "isolinux_mbr=", 13)==0) {
sprintf(sfe, "isohybrid=%s", argpt + 13);
ret= Xorriso_option_boot_image(xorriso, "isolinux", sfe, 0);
if(ret <= 0)
goto problem_handler_boot;
} else if(strcmp(argv[i], "-eltorito-alt-boot")==0) {
} else if(strcmp(argpt, "-eltorito-alt-boot")==0) {
ret= Xorriso_genisofs_add_boot(xorriso, whom,
&option_b, &emul_boot, 0);
if(ret <= 0)
goto problem_handler_boot;
} else if(strcmp(argv[i], "--embedded-boot")==0 ||
strcmp(argv[i], "-generic-boot")==0 ||
strcmp(argv[i], "-G") == 0 ||
strcmp(argv[i], "-isohybrid-mbr")==0) {
} else if(strcmp(argpt, "--embedded-boot")==0 ||
strcmp(argpt, "-generic-boot")==0 ||
strcmp(argpt, "-G") == 0 ||
strcmp(argpt, "-isohybrid-mbr")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
ret= Xorriso_set_system_area_path(xorriso, argv[i], 0);
if(ret <= 0)
goto problem_handler_boot;
if(strcmp(argv[i - 1], "-isohybrid-mbr")==0)
if(strcmp(argpt, "-isohybrid-mbr")==0)
xorriso->system_area_options= (xorriso->system_area_options & ~3) | 2;
} else if(strcmp(argv[i], "--protective-msdos-label")==0) {
} else if(strcmp(argpt, "--protective-msdos-label")==0) {
xorriso->system_area_options= (xorriso->system_area_options & ~3) | 1;
} else if(strcmp(argv[i], "--boot-catalog-hide")==0) {
} else if(strcmp(argpt, "--boot-catalog-hide")==0) {
xorriso->boot_image_cat_hidden|= 3;
} else if(strcmp(argv[i], "-partition_offset") == 0 ||
strcmp(argv[i], "-partition_sec_hd") == 0 ||
strcmp(argv[i], "-partition_hd_cyl") == 0 ||
strcmp(argv[i], "-partition_cyl_align") == 0) {
} else if(strcmp(argpt, "-partition_offset") == 0 ||
strcmp(argpt, "-partition_sec_hd") == 0 ||
strcmp(argpt, "-partition_hd_cyl") == 0 ||
strcmp(argpt, "-partition_cyl_align") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
sprintf(sfe, "%s=%.16s", argv[i-1] + 1, argv[i]);
sprintf(sfe, "%s=%.16s", argpt + 1, argv[i]);
ret= Xorriso_option_boot_image(xorriso, "any", sfe, 0);
if(ret <= 0)
goto problem_handler_boot;
} else if(strcmp(argv[i], "-mips-boot") == 0 ||
strcmp(argv[i], "-mipsel-boot") == 0) {
} else if(strcmp(argpt, "-mips-boot") == 0 ||
strcmp(argpt, "-mipsel-boot") == 0) {
if(i + 1 >= argc)
goto not_enough_args;
i++;
if(strcmp(argv[i - 1], "-mipsel-boot") == 0)
if(strcmp(argpt, "-mipsel-boot") == 0)
strcpy(sfe, "mipsel_path=");
else
strcpy(sfe, "mips_path=");

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.03.29.151144"
#define Xorriso_timestamP "2011.04.01.133116"