Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lhasa cannot extract empty directories from amiga lha archives. #37

Closed
alfredone opened this issue Jan 11, 2022 · 3 comments
Closed

Lhasa cannot extract empty directories from amiga lha archives. #37

alfredone opened this issue Jan 11, 2022 · 3 comments

Comments

@alfredone
Copy link

lhasa stops unpacking an archive when it encounters an empty directory.
Tested with an amiga lha archive.

@alfredone
Copy link
Author

MainDir.lha.zip

This is the content of MainDir.lha:

MainDir

00_File.txt
01_Dir

File01.txt

02_EmptyDir
03_Dir

File01.txt

04_File.txt

Extracting with lhasa gives the following result:

MainDir

00_File.txt
01_Dir

File01.txt

@jsummers
Copy link

This is probably the same issue as issue #31.

The problem is that the item that should have been a directory (type "lhd") is erroneously stored as a regular file (type "lh0"), due to a bug in whatever program created the LHA file. The item does not have a filename; it only has a directory name. Lhasa treats a file without a filename as a fatal error.

@fragglet
Copy link
Owner

Can confirm this is the same issue as #31:

00000070  ff 05 00 00 c6 53 00 00  46 69 6c 65 30 31 19 4c  |.....S..File01.L|
                                                     \_ start of header

00000080  2d 6c 68 30 2d 1c 00 00  00 00 00 00 00 53 a7 2b  |-lh0-........S.+|
00000090  54 00 01 00 00 00 41 17  00 02 4d 61 69 6e 44 69  |T.....A...MainDi|
                  |                   \_ start of path header
                   \_ length of filename = 0

000000a0  72 ff 30 32 5f 45 6d 70  74 79 44 69 72 ff 05 00  |r.02_EmptyDir...|
000000b0  00 0f 31 00 00 23 a5 2d  6c 68 30 2d 1d 00 00 00  |..1..#.-lh0-....|
         |         \_ no next header; end of headers
          \_ start of common header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants