Some polishing with -cpx

This commit is contained in:
Thomas Schmitt 2008-05-24 17:00:47 +00:00
parent 1b6e8b94b3
commit 691504c6ce
3 changed files with 10 additions and 8 deletions

View File

@ -8637,7 +8637,7 @@ int Xorriso_option_cpx(struct XorrisO *xorriso, int argc, char **argv,
if(ret<=0 || xorriso->request_to_abort) if(ret<=0 || xorriso->request_to_abort)
goto problem_handler; goto problem_handler;
ret= Xorriso_iso_lstat(xorriso, eff_origin, &stbuf, 2); ret= Xorriso_iso_lstat(xorriso, eff_origin, &stbuf, 2|4);
if(ret==-1) if(ret==-1)
goto problem_handler; goto problem_handler;
if(S_ISDIR(stbuf.st_mode)) { if(S_ISDIR(stbuf.st_mode)) {

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.05.24.092853" #define Xorriso_timestamP "2008.05.24.170109"

View File

@ -1313,7 +1313,7 @@ int Xorriso_node_from_path(struct XorrisO *xorriso, IsoImage *volume,
*node= NULL; *node= NULL;
ret= iso_tree_path_to_node(volume, path_pt, node); ret= iso_tree_path_to_node(volume, path_pt, node);
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
if(ret<=0) { if(ret<=0 || (*node)==NULL) {
if(!(flag&1)) { if(!(flag&1)) {
sprintf(xorriso->info_text, "Cannot find path %s in loaded ISO image", sprintf(xorriso->info_text, "Cannot find path %s in loaded ISO image",
Text_shellsafe(path_pt, sfe, 0)); Text_shellsafe(path_pt, sfe, 0));
@ -1475,9 +1475,9 @@ int Xorriso_get_node_by_path(struct XorrisO *xorriso,
/* <<< this is not safe /* <<< this is not safe
*/
#define Xorriso_can_get_dev_T 1 #define Xorriso_can_get_dev_T 1
#define Xorriso_get_dev_by_botcH 1 #define Xorriso_get_dev_by_botcH 1
*/
#ifndef Xorriso_can_get_dev_T #ifndef Xorriso_can_get_dev_T
@ -1557,6 +1557,7 @@ struct Iso_Special_0_6_4_xorrisO
/* @param flag bit0= *node is already valid /* @param flag bit0= *node is already valid
bit1= add extra block for size estimation bit1= add extra block for size estimation
bit2= complain loudely if path is missing in image
*/ */
int Xorriso_fake_stbuf(struct XorrisO *xorriso, char *path, struct stat *stbuf, int Xorriso_fake_stbuf(struct XorrisO *xorriso, char *path, struct stat *stbuf,
IsoNode **node, int flag) IsoNode **node, int flag)
@ -1569,7 +1570,7 @@ int Xorriso_fake_stbuf(struct XorrisO *xorriso, char *path, struct stat *stbuf,
ret= Xorriso_get_volume(xorriso, &volume, 0); ret= Xorriso_get_volume(xorriso, &volume, 0);
if(ret<=0) if(ret<=0)
return(-1); return(-1);
ret= Xorriso_node_from_path(xorriso, volume, path, node, 1); ret= Xorriso_node_from_path(xorriso, volume, path, node, !(flag&4));
if(ret<=0) if(ret<=0)
*node= NULL; *node= NULL;
} }
@ -1625,7 +1626,8 @@ int Xorriso_fake_stbuf(struct XorrisO *xorriso, char *path, struct stat *stbuf,
/* @param flag >>> bit0= follow links (i.e. stat() rather than lstat() /* @param flag >>> bit0= follow links (i.e. stat() rather than lstat()
bit1= do not return -2 on sever errors bit1= do not return -2 on severe errors
bit2= complain loudely if path is missing in image
*/ */
int Xorriso_iso_lstat(struct XorrisO *xorriso, char *path, struct stat *stbuf, int Xorriso_iso_lstat(struct XorrisO *xorriso, char *path, struct stat *stbuf,
int flag) int flag)
@ -1639,10 +1641,10 @@ int Xorriso_iso_lstat(struct XorrisO *xorriso, char *path, struct stat *stbuf,
} }
ret= Xorriso_fake_stbuf(xorriso, path, stbuf, &node, 0); ret= Xorriso_fake_stbuf(xorriso, path, stbuf, &node, flag&4);
if(ret>0) if(ret>0)
return(0); return(0);
if(ret<0) if(ret<0 && !(flag&2))
return(-2); return(-2);
return(-1); return(-1);
} }