Fix several bugs related to RR SL/NM fields (PT 2 :).

release-1.5.4.branch
Vreixo Formoso 15 years ago
parent 5f6b5fd930
commit ddd703e7c4
  1. 2
      src/ecma119.c
  2. 21
      src/rockridge.c

@ -417,7 +417,7 @@ int write_one_dir(Ecma119Image *t, Ecma119Node *dir)
/* compute len of directory entry */
fi_len = strlen(child->iso_name);
len = fi_len + 33 + (fi_len % 2 ? 0 : 1);
if (child->type == ECMA119_FILE && !t->omit_version_numbers) {
if (need_version_number(t, child)) {
len += 2;
}

@ -15,7 +15,6 @@
#include <string.h>
static
int susp_append(Ecma119Image *t, struct susp_info *susp, uint8_t *data)
{
@ -347,7 +346,7 @@ int rrip_add_SL(Ecma119Image *t, struct susp_info *susp,
if (ret < 0) {
return ret;
}
written = i - 1;
written = i;
total_comp_len = comp[i][1] + 2;
}
}
@ -599,7 +598,7 @@ size_t rrip_calc_len(Ecma119Image *t, Ecma119Node *n, int type,
* anything in this SL
*/
*ce += sl_len + 255;
sl_len = 5 + (clen - 250);
sl_len = 5 + (clen - 250) + 2;
}
} else {
/* case 2, create a new SL entry */
@ -884,7 +883,7 @@ int rrip_get_susp_fields(Ecma119Image *t, Ecma119Node *n, int type,
* and another SL entry
*/
ret = rrip_SL_append_comp(&n_comp, &comps,
prev, fit, cflag);
prev, fit, 0x01);
if (ret < 0) {
goto add_susp_cleanup;
}
@ -895,7 +894,7 @@ int rrip_get_susp_fields(Ecma119Image *t, Ecma119Node *n, int type,
ret = rrip_SL_append_comp(&n_comp, &comps,
prev + fit,
clen - fit - 2,
cflag);
0);
if (ret < 0) {
goto add_susp_cleanup;
}
@ -908,13 +907,19 @@ int rrip_get_susp_fields(Ecma119Image *t, Ecma119Node *n, int type,
* anything in this SL
*/
ret = rrip_SL_append_comp(&n_comp, &comps,
prev, 250 - 2,
cflag);
prev, 248, 0x01);
if (ret < 0) {
goto add_susp_cleanup;
}
ret = rrip_SL_append_comp(&n_comp, &comps,
prev + 248,
strlen(prev + 248),
0x00);
if (ret < 0) {
goto add_susp_cleanup;
}
ce_len += sl_len + 255;
sl_len = 5 + (clen - 250);
sl_len = 5 + (clen - 250) + 2;
}
} else {
/* case 2, create a new SL entry */

Loading…
Cancel
Save