From 75049af8430e03765b8879178d1b40b59d03e6f0 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 28 Oct 2007 17:45:01 +0000 Subject: [PATCH] Warning of wildcards in paths --- test/xorriso.c | 24 +++++++++++++++++------- test/xorriso_timestamp.h | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/test/xorriso.c b/test/xorriso.c index 3c446545..529ff078 100644 --- a/test/xorriso.c +++ b/test/xorriso.c @@ -2961,6 +2961,18 @@ ex: } +int Xorriso_warn_of_wildcards(struct XorrisO *xorriso, char *path, int flag) +{ + if(strchr(path,'*')!=NULL || strchr(path,'?')!=NULL) { + sprintf(xorriso->info_text, + "Xorriso does not support address wildcards '*' and '?'"); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); + return(1); + } + return(0); +} + + int Xorriso_end_idx(struct XorrisO *xorriso, int argc, char **argv, int idx, int flag) { @@ -2969,12 +2981,8 @@ int Xorriso_end_idx(struct XorrisO *xorriso, for(i= idx; iinfo_text, - "Xorriso does not support address wildcards '*' and '?'"); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); - warned= 1; - } + if(!warned) + warned= Xorriso_warn_of_wildcards(xorriso, argv[i], 0); } return(i); } @@ -3282,6 +3290,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); return(0); } + Xorriso_warn_of_wildcards(xorriso, iso_rr_path, 0); sprintf(xorriso->info_text,"previous working directory:\n"); Xorriso_info(xorriso,0); sprintf(xorriso->result_line,"%s/\n",Text_shellsafe(xorriso->wdi, sfe, 0)); @@ -3304,7 +3313,7 @@ int Xorriso_option_cdi(struct XorrisO *xorriso, char *iso_rr_path, int flag) return(ret); if(ret==0) { sprintf(xorriso->info_text, "-cdi: not existing yet in ISO image : %s", - Text_shellsafe(eff_path, sfe, 0)); + Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); ret= Xorriso_normalize_img_path(xorriso, path, eff_path, 2); if(ret<=0) @@ -3334,6 +3343,7 @@ int Xorriso_option_cdx(struct XorrisO *xorriso, char *disk_path, int flag) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } + Xorriso_warn_of_wildcards(xorriso, disk_path, 0); sprintf(xorriso->info_text,"previous working directory on hard disk:\n"); Xorriso_info(xorriso,0); sprintf(xorriso->result_line,"%s/\n",Text_shellsafe(xorriso->wdx, sfe, 0)); diff --git a/test/xorriso_timestamp.h b/test/xorriso_timestamp.h index 40688781..bbbef1d8 100644 --- a/test/xorriso_timestamp.h +++ b/test/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2007.10.28.165516" +#define Xorriso_timestamP "2007.10.28.174550"