Skip to content

Commit

Permalink
Issue erlang#8099: Add guard to binary:join/2 to handle lists with si…
Browse files Browse the repository at this point in the history
…ngle element and ensure it is a binary
  • Loading branch information
onno-vos-dev committed Feb 8, 2024
1 parent 036b654 commit 59ac3a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/stdlib/src/binary.erl
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ _Example:_
-doc(#{since => <<"OTP 27.0">>}).
-spec join([binary()], binary()) -> binary().
join([], _Separator) -> <<>>;
join([H], _Separator) -> H;
join([H], _Separator) when is_binary(H) -> H;
join([H | T], Separator) ->
Acc = <<>>,
join(T, Separator, <<Acc/binary, H/binary>>).
Expand Down

0 comments on commit 59ac3a7

Please sign in to comment.