Normalized paths to target and source before adding or removing from image

This commit is contained in:
Thomas Schmitt 2007-10-24 10:02:15 +00:00
parent e7d72ecfa4
commit 64bf184789
3 changed files with 28 additions and 3 deletions

View File

@ -3103,7 +3103,7 @@ int Xorriso_option_add(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag) int *idx, int flag)
{ {
int i, end_idx, ret; int i, end_idx, ret;
char target[SfileadrL], source[SfileadrL], *ept; char target[SfileadrL], source[SfileadrL], *ept, eff_path[SfileadrL];
end_idx= Xorriso__end_idx(argc, argv, *idx, 0); end_idx= Xorriso__end_idx(argc, argv, *idx, 0);
@ -3128,6 +3128,16 @@ int Xorriso_option_add(struct XorrisO *xorriso, int argc, char **argv,
if(ret<=0) if(ret<=0)
goto ex; goto ex;
} }
ret= Xorriso_normalize_img_path(xorriso, target, eff_path, 2);
if(ret<=0)
return(ret);
strcpy(target, eff_path);
ret= Xorriso_normalize_img_path(xorriso, source, eff_path, 2);
if(ret<=0)
return(ret);
strcpy(source, eff_path);
ret= Xorriso_graft_in(xorriso, source, target, 0); ret= Xorriso_graft_in(xorriso, source, target, 0);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
@ -4359,7 +4369,7 @@ int Xorriso_option_rmi(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag) int *idx, int flag)
{ {
int i, end_idx, ret; int i, end_idx, ret;
char path[SfileadrL]; char path[SfileadrL], eff_path[SfileadrL];
end_idx= Xorriso__end_idx(argc, argv, *idx, 0); end_idx= Xorriso__end_idx(argc, argv, *idx, 0);
@ -4371,6 +4381,11 @@ int Xorriso_option_rmi(struct XorrisO *xorriso, int argc, char **argv,
if(ret<=0) if(ret<=0)
goto ex; goto ex;
} }
ret= Xorriso_normalize_img_path(xorriso, path, eff_path, 2);
if(ret<=0)
return(ret);
strcpy(path, eff_path);
ret= Xorriso_rmi(xorriso, path, flag&1); ret= Xorriso_rmi(xorriso, path, flag&1);
if(ret<=0) if(ret<=0)
goto ex; goto ex;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2007.10.23.122753" #define Xorriso_timestamP "2007.10.24.100156"

View File

@ -644,11 +644,21 @@ int Xorriso_graft_in(struct XorrisO *xorriso, char *disk_path, char *img_path,
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);
} }
/* >>> copy properties from correspondent directory in disk_path
if there is any */;
} }
if(done) { if(done) {
attach_source:; attach_source:;
if(is_dir) { if(is_dir) {
/* >>> do this by own recursive operation in order to gain
full control with overwriting */;
iso_tree_radd_dir(dir, disk_path, &behav); iso_tree_radd_dir(dir, disk_path, &behav);
} else { } else {
node= iso_tree_add_node(dir, disk_path); node= iso_tree_add_node(dir, disk_path);
if(node == NULL) { if(node == NULL) {