Better handling of not-yet-existing -cd
This commit is contained in:
@ -7349,6 +7349,7 @@ int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv,
|
||||
int ret, end_idx, filec= 0, nump, i;
|
||||
char **filev= NULL, **patterns= NULL;
|
||||
off_t mem= 0;
|
||||
struct stat stbuf;
|
||||
|
||||
end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1);
|
||||
if(xorriso->do_iso_rr_pattern==0)
|
||||
@ -7358,6 +7359,18 @@ int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv,
|
||||
if((flag&2) && nump>0 ) {
|
||||
;
|
||||
} else if(nump <= 0) {
|
||||
if(Xorriso_iso_lstat(xorriso, xorriso->wdi, &stbuf, 0)==-1) {
|
||||
sprintf(xorriso->info_text,
|
||||
"Current -cd path does not yet exist in the ISO image");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
|
||||
{ret= 0; goto ex;}
|
||||
}
|
||||
if(!S_ISDIR(stbuf.st_mode)) {
|
||||
sprintf(xorriso->info_text,
|
||||
"Current -cd meanwhile points to a non-directory in ISO image");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
|
||||
{ret= 0; goto ex;}
|
||||
}
|
||||
patterns= calloc(1, sizeof(char *));
|
||||
if(patterns == NULL) {
|
||||
no_memory:;
|
||||
|
Reference in New Issue
Block a user