Corrected warning function about wildcards

This commit is contained in:
Thomas Schmitt 2007-12-06 19:25:49 +00:00
parent 75d2373c1c
commit e63ffdc805
2 changed files with 15 additions and 7 deletions

View File

@ -4002,13 +4002,21 @@ ex:;
} }
/* @param flag bit0= command without pattern capability
bit1= disk_pattern rather than iso_rr_pattern
*/
int Xorriso_warn_of_wildcards(struct XorrisO *xorriso, char *path, int flag) int Xorriso_warn_of_wildcards(struct XorrisO *xorriso, char *path, int flag)
{ {
if(strchr(path,'*')!=NULL || strchr(path,'?')!=NULL || if(strchr(path,'*')!=NULL || strchr(path,'?')!=NULL ||
strchr(path,'[')!=NULL) { strchr(path,'[')!=NULL) {
sprintf(xorriso->info_text, if(flag&1) {
"Pattern expansion of wildcards \"*?[\" is disabled%s", sprintf(xorriso->info_text,
xorriso->do_iso_rr_pattern!=1 ? "command -iso_rr_pattern off" : ""); "Pattern expansion of wildcards \"*?[\" does not apply to this command");
} else {
sprintf(xorriso->info_text,
"Pattern expansion of wildcards \"*?[\" is disabled by command %s",
(flag&2) ? "-disk_pattern" : "-iso_rr_pattern");
}
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
return(1); return(1);
} }
@ -4028,7 +4036,7 @@ int Xorriso_end_idx(struct XorrisO *xorriso,
if(strcmp(argv[i], "--")==0) if(strcmp(argv[i], "--")==0)
break; break;
if(!((flag&1) || warned)) if(!((flag&1) || warned))
warned= Xorriso_warn_of_wildcards(xorriso, argv[i], 0); warned= Xorriso_warn_of_wildcards(xorriso, argv[i], flag&2);
} }
return(i); return(i);
} }
@ -4973,7 +4981,7 @@ int Xorriso_option_cdi(struct XorrisO *xorriso, char *iso_rr_path, int flag)
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
return(0); return(0);
} }
Xorriso_warn_of_wildcards(xorriso, iso_rr_path, 0); Xorriso_warn_of_wildcards(xorriso, iso_rr_path, 1);
sprintf(xorriso->info_text,"previous working directory:\n"); sprintf(xorriso->info_text,"previous working directory:\n");
Xorriso_info(xorriso,0); Xorriso_info(xorriso,0);
sprintf(xorriso->result_line,"%s/\n",Text_shellsafe(xorriso->wdi, sfe, 0)); sprintf(xorriso->result_line,"%s/\n",Text_shellsafe(xorriso->wdi, sfe, 0));
@ -5026,7 +5034,7 @@ int Xorriso_option_cdx(struct XorrisO *xorriso, char *disk_path, int flag)
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
return(0); return(0);
} }
Xorriso_warn_of_wildcards(xorriso, disk_path, 0); Xorriso_warn_of_wildcards(xorriso, disk_path, 1|2);
sprintf(xorriso->info_text,"previous working directory on hard disk:\n"); sprintf(xorriso->info_text,"previous working directory on hard disk:\n");
Xorriso_info(xorriso,0); Xorriso_info(xorriso,0);
sprintf(xorriso->result_line,"%s/\n",Text_shellsafe(xorriso->wdx, sfe, 0)); sprintf(xorriso->result_line,"%s/\n",Text_shellsafe(xorriso->wdx, sfe, 0));

View File

@ -1 +1 @@
#define Xorriso_timestamP "2007.12.06.150102" #define Xorriso_timestamP "2007.12.06.192437"