Enabled recognition of zisofs by magic without zlib support. New by_magic=v2
This commit is contained in:
@ -2263,9 +2263,9 @@ int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag)
|
||||
{
|
||||
int was_level, was_blocksize, was_v2_enabled, was_blocksize_v2;
|
||||
uint64_t was_max_total_blocks, was_max_file_blocks, was_block_number_target;
|
||||
int ret, l, i, sticky;
|
||||
int ret, l, i, sticky, set_isofs_params= 0;
|
||||
double num, was_bpt_discard_free_ratio;
|
||||
char *cpt, *npt, text[16];
|
||||
char *cpt, *npt;
|
||||
|
||||
was_level= xorriso->zlib_level;
|
||||
was_blocksize= xorriso->zisofs_block_size;
|
||||
@ -2304,12 +2304,7 @@ int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag)
|
||||
/* (ignored info from -status) */;
|
||||
|
||||
} else if(strncmp(cpt, "block_size=", 11)==0) {
|
||||
num= 0.0;
|
||||
if(l > 11 && l < 27) {
|
||||
strncpy(text, cpt + 11, l - 11);
|
||||
text[l - 11]= 0;
|
||||
num= Scanf_io_size(text, 0);
|
||||
}
|
||||
parse_zisofs_param(cpt, 11, l, &num);
|
||||
if (num != (1 << 15) && num != (1 << 16) && num != (1 << 17)) {
|
||||
sprintf(xorriso->info_text,
|
||||
"-zisofs: Unsupported block size (allowed 32k, 64k, 128k)");
|
||||
@ -2318,17 +2313,24 @@ int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag)
|
||||
xorriso->zisofs_block_size= num;
|
||||
|
||||
} else if(strncmp(cpt, "by_magic=", 9)==0) {
|
||||
if(strncmp(cpt + 9, "on", l - 9) == 0)
|
||||
if(strncmp(cpt + 9, "on", l - 9) == 0) {
|
||||
xorriso->zisofs_by_magic= 1;
|
||||
else
|
||||
} else if(strncmp(cpt + 9, "v2", l - 9) == 0) {
|
||||
xorriso->zisofs_by_magic= 2;
|
||||
} else if(strncmp(cpt + 9, "off", l - 9) == 0) {
|
||||
xorriso->zisofs_by_magic= 0;
|
||||
} else {
|
||||
sprintf(xorriso->info_text,
|
||||
"-zisofs: Unrecognized by_magic mode (allowed: on, off, v2)");
|
||||
goto sorry_ex;
|
||||
}
|
||||
|
||||
} else if(strncmp(cpt, "version_2=", 10) == 0) {
|
||||
if(strncmp(cpt + 10, "off", l - 10) == 0) {
|
||||
xorriso->zisofs_v2_enabled= 0;
|
||||
} else if(strncmp(cpt + 10, "as_needed", l - 11) == 0) {
|
||||
} else if(strncmp(cpt + 10, "as_needed", l - 10) == 0) {
|
||||
xorriso->zisofs_v2_enabled= 1;
|
||||
} else if(strncmp(cpt + 10, "on", l - 11) == 0) {
|
||||
} else if(strncmp(cpt + 10, "on", l - 10) == 0) {
|
||||
xorriso->zisofs_v2_enabled= 2;
|
||||
} else {
|
||||
sprintf(xorriso->info_text,
|
||||
@ -2420,8 +2422,13 @@ sorry_ex:
|
||||
xorriso->zisofs_bpt_discard_free_ratio= was_bpt_discard_free_ratio;
|
||||
return(0);
|
||||
}
|
||||
|
||||
if(strncmp(cpt, "by_magic=", 9) != 0)
|
||||
set_isofs_params= 1;
|
||||
}
|
||||
ret= Xorriso_set_zisofs_params(xorriso, 0);
|
||||
ret= 1;
|
||||
if(set_isofs_params)
|
||||
ret= Xorriso_set_zisofs_params(xorriso, 0);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user