New command -update_lxi
This commit is contained in:
@ -82,6 +82,7 @@ int Xorriso_end_idx(struct XorrisO *xorriso,
|
||||
bit7= silently tolerate empty argument list
|
||||
bit8= free the eventually allocated sub_vector
|
||||
bit9= always expand wildcards
|
||||
bit10= do not add unresolved pattern to optv
|
||||
*/
|
||||
int Xorriso_opt_args(struct XorrisO *xorriso, char *cmd,
|
||||
int argc, char **argv, int idx,
|
||||
@ -116,10 +117,19 @@ int Xorriso_opt_args(struct XorrisO *xorriso, char *cmd,
|
||||
return(*end_idx);
|
||||
if((flag&16) && (*end_idx)>idx)
|
||||
(*end_idx)--;
|
||||
|
||||
*optc= *end_idx - idx;
|
||||
*optv= argv+idx;
|
||||
if(*optc<=0 || !do_expand)
|
||||
*optv= NULL;
|
||||
if(*optc<=0 || !do_expand) {
|
||||
if(*optc > 0) {
|
||||
Xorriso_alloc_meM(*optv, char *, *optc);
|
||||
for(i= 0; i < *optc; i++) {
|
||||
Xorriso_alloc_meM((*optv)[i], char, strlen(argv[idx + i]) + 1);
|
||||
strcpy((*optv)[i], argv[idx + i]);
|
||||
}
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
patterns= calloc(*optc, sizeof(char *));
|
||||
if(patterns==NULL) {
|
||||
no_memory:;
|
||||
@ -147,10 +157,12 @@ no_memory:;
|
||||
}
|
||||
if(flag&2)
|
||||
ret= Xorriso_expand_disk_pattern(xorriso, nump, patterns, was_empty,
|
||||
&filec, &filev, &mem, (flag>>5)&3);
|
||||
&filec, &filev, &mem,
|
||||
((flag >> 5) & 3) | ((!!(flag & 1024)) << 3));
|
||||
else
|
||||
ret= Xorriso_expand_pattern(xorriso, nump, patterns, was_empty,
|
||||
&filec, &filev, &mem, (flag>>5)&3);
|
||||
&filec, &filev, &mem,
|
||||
((flag >> 5) & 3) | ((!!(flag & 1024)) << 3));
|
||||
if(ret<=0)
|
||||
{ret= 0; goto ex;}
|
||||
for(i= 0; i<was_empty; i++) {
|
||||
@ -580,7 +592,8 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
|
||||
"getfattr","getfattri","getfattr_r","getfattr_ri","hide",
|
||||
"launch_frontend","ls","lsi","lsl","lsli","lsd","lsdi","lsdl","lsdli",
|
||||
"lsx","lslx","lsdx","lsdlx","map_l","mv","mvi","mkdir","mkdiri",
|
||||
"not_paths","rm","rmi","rm_r","rm_ri","rmdir","rmdiri","update_l",
|
||||
"not_paths","rm","rmi","rm_r","rm_ri","rmdir","rmdiri",
|
||||
"update_l","update_lx","update_lxi",
|
||||
"setfacl","setfacli","setfacl_list","setfacl_listi",
|
||||
"setfacl_r","setfacl_ri","setfattr","setfattri",
|
||||
"setfattr_list","setfattr_listi","setfattr_r","setfattr_ri",
|
||||
@ -704,7 +717,8 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
|
||||
"* Inserting files into ISO image:",
|
||||
"disk_pattern", "add_plainly",
|
||||
"mkdir", "lns", "add", "path_list", "quoted_path_list",
|
||||
"map", "map_single", "map_l", "update", "update_r", "update_l",
|
||||
"map", "map_single", "map_l", "update", "update_r",
|
||||
"update_l", "update_lx", "update_lxi",
|
||||
"cut_out", "cpr",
|
||||
"clone", "cp_clone",
|
||||
|
||||
@ -1927,9 +1941,12 @@ if (0) {
|
||||
(*idx)+= 2;
|
||||
ret= Xorriso_option_update(xorriso, arg1, arg2, 1);
|
||||
|
||||
} else if(strcmp(cmd,"update_l")==0) {
|
||||
} else if(strcmp(cmd,"update_l") == 0 || strcmp(cmd,"update_lx") == 0) {
|
||||
ret= Xorriso_option_map_l(xorriso, argc, argv, idx, 2<<8);
|
||||
|
||||
} else if(strcmp(cmd,"update_lxi") == 0) {
|
||||
ret= Xorriso_option_map_l(xorriso, argc, argv, idx, 4 << 8);
|
||||
|
||||
} else if(strcmp(cmd,"update_r")==0) {
|
||||
(*idx)+= 2;
|
||||
ret= Xorriso_option_update(xorriso, arg1, arg2, 1|8);
|
||||
|
Reference in New Issue
Block a user