Closed alfredone closed 1 year ago
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
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.
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
lhasa stops unpacking an archive when it encounters an empty directory. Tested with an amiga lha archive.