New command -update_lxi
This commit is contained in:
@ -1311,3 +1311,26 @@ int Xorriso__to_upper(char *in, char *out, int out_size, int flag)
|
||||
return(in[i] == 0);
|
||||
}
|
||||
|
||||
|
||||
/* @param flag bit0= prepend target_prefix even if source_prefix does not get
|
||||
removed
|
||||
*/
|
||||
int Xorriso__exchange_prefix(char *source_prefix, char *target_prefix,
|
||||
char *eff_source, char *eff_target, int flag)
|
||||
{
|
||||
char *source_pt;
|
||||
|
||||
strcpy(eff_target, target_prefix);
|
||||
source_pt= eff_source;
|
||||
if(source_prefix[0]) {
|
||||
if(strncmp(source_prefix, eff_source, strlen(source_prefix)) != 0) {
|
||||
if(!(flag & 1))
|
||||
return(0);
|
||||
} else {
|
||||
source_pt+= strlen(source_prefix);
|
||||
}
|
||||
}
|
||||
strcat(eff_target, source_pt);
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user