Skip to content

Commit 0879b6f

Browse files
authored
Fix compatibility with OTP 18 and 17 (#84)
1 parent d4f472d commit 0879b6f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/main.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,24 @@ jobs:
2222
elixir: 1.5.3
2323
- erlang: 17.5
2424
elixir: 1.1.1
25+
env:
26+
REBAR3_VERSION: 3.6.1
2527
steps:
2628
- uses: actions/checkout@v1
2729

2830
- name: Install OTP
29-
uses: actions/setup-elixir@v1
31+
uses: ericmj/setup-elixir@3f15364
3032
with:
3133
otp-version: ${{matrix.pair.erlang}}
3234
elixir-version: ${{matrix.pair.elixir}}
3335

36+
- name: Install rebar3
37+
run: |
38+
wget https://github.com/erlang/rebar3/releases/download/${REBAR3_VERSION}/rebar3 -O rebar3
39+
chmod +x rebar3
40+
./rebar3 -v
41+
3442
- name: Run tests
3543
run: |
36-
rebar3 ct
37-
rebar3 as test proper
44+
./rebar3 ct
45+
./rebar3 as test proper

src/hex_erl_tar.erl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ write_extracted_element(#tar_header{name=Name0}=Header, Bin, Opts) ->
16491649
make_safe_path([$/|Path], Opts) ->
16501650
make_safe_path(Path, Opts);
16511651
make_safe_path(Path, #read_opts{cwd=Cwd}) ->
1652-
case filename:safe_relative_path(Path) of
1652+
case hex_filename:safe_relative_path(Path) of
16531653
unsafe ->
16541654
throw({error,{Path,unsafe_path}});
16551655
SafePath ->
@@ -1687,7 +1687,7 @@ safe_relative_path_links([Segment|Segments], Cwd, PrevSegments, Acc) ->
16871687
end;
16881688

16891689
{error, _} ->
1690-
case filename:safe_relative_path(join(Acc, Segment)) of
1690+
case hex_filename:safe_relative_path(join(Acc, Segment)) of
16911691
unsafe ->
16921692
unsafe;
16931693
NewAcc ->

0 commit comments

Comments
 (0)