Skip to content

Commit

Permalink
Workaround for not using the -lhd- method for directory entries in ol…
Browse files Browse the repository at this point in the history
…d header
  • Loading branch information
jca02266 committed Dec 12, 2020
1 parent 28099f3 commit 959d248
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,17 @@ get_header(fp, hdr)
filename_case = NONE;
break;

case EXTEND_AMIGA:
{
/* workaround */
size_t len = strlen(hdr->name);
if (len > 0 && (unsigned char)hdr->name[len-1] == LHA_PATHSEP
&& memcmp(hdr->method, LZHUFF0_METHOD, sizeof(hdr->method)) == 0) {
/* replace with "-lhd-" */
memcpy(hdr->method, LZHDIRS_METHOD, sizeof(hdr->method));
}
}
break;
default:
filename_case = convertcase ? TO_LOWER : NONE;
break;
Expand Down
1 change: 1 addition & 0 deletions src/lha_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
#define EXTEND_CPM 'C'
#define EXTEND_FLEX 'F'
#define EXTEND_RUNSER 'R'
#define EXTEND_AMIGA 'A'

/* this OS type is not official */

Expand Down

0 comments on commit 959d248

Please sign in to comment.