Backported fix for issue where using joliet without Rockridge would create broken iso

This commit is contained in:
Mario Danic 2006-09-20 08:45:30 +00:00
parent c09a0f2878
commit eb0225d11d
3 changed files with 33 additions and 0 deletions

View File

@ -319,6 +319,8 @@ ecma119_target_new(struct iso_volset *volset,
if (t->joliet)
joliet_calc_dir_pos(t, t->joliet_root);
calc_file_pos(t, t->root);
if (t->joliet)
joliet_update_file_pos (t, t->joliet_root);
if (t->rockridge) {
susp_finalize(t, t->root);

View File

@ -142,6 +142,30 @@ joliet_calc_dir_pos(struct ecma119_write_target *t,
t->curfile = 0;
}
void
joliet_update_file_pos(struct ecma119_write_target *t,
struct joliet_tree_node *dir)
{
size_t i;
assert(dir && ISO_ISDIR(dir->iso_self));
for (i = 0; i < dir->nchildren; i++) {
struct joliet_tree_node *ch;
ch = dir->children[i];
if (!ISO_ISDIR (ch->iso_self)) {
struct iso_tree_node *iso = ch->iso_self;
ch->block = iso->block;
}
else
joliet_update_file_pos(t, ch);
}
/* reset curfile when we're finished */
if (!dir->parent)
t->curfile = 0;
}
struct joliet_tree_node*
joliet_tree_create(struct ecma119_write_target *t,
struct iso_tree_node *iso_root)

View File

@ -52,6 +52,13 @@ joliet_calc_dir_size(struct ecma119_write_target *t, struct joliet_tree_node*);
void
joliet_calc_dir_pos(struct ecma119_write_target *t, struct joliet_tree_node*);
/**
* Update the position of each file in the joliet hierarchy (to be called
* AFTER the file positions in the iso tree have been set).
*/
void
joliet_update_file_pos(struct ecma119_write_target *t, struct joliet_tree_node*);
/**
* Calculate the size of the joliet path table and fill in the list of
* directories.