AgentD / squashfs-tools-ng

A new set of tools and libraries for working with SquashFS images
Other
194 stars 30 forks source link

sqfs2tar some directories are missing a trailing slash #42

Closed josch closed 4 years ago

josch commented 4 years ago

Hi,

thanks for c835ac7 but some directories still don't have a trailing slash. :(

The only thing all the directories without a slash seem to have in common is that they are empty directories. I did some tests and as soon as I place something into a directory, sqfs2tar will produce the slash. Could you look into it again?

Thanks!

josch commented 4 years ago

Maybe the issue is, that the is_dir argument of assemble_tar_path is set by n->children != NULL? Maybe instead something like this has to be done:

inode_stat(n, &sb);
[...]
name = assemble_tar_path(name, (sb->st_mode & S_IFMT) == S_IFDIR)
AgentD commented 4 years ago

Yes, the simple check whether a node has children obviously misses empty directories.

Should be fixed, 44fb01e8a8417fadd79ba347c9ad3f0bb3a1d0b8

Thanks!