New command -update_lxi

This commit is contained in:
2016-12-05 14:35:04 +01:00
parent 9b75d21e2a
commit 7b12dd0dda
12 changed files with 267 additions and 94 deletions

View File

@ -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);
}