From 67fef1fa2639e9565eb354234a389ad3b6501592 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Wed, 23 Jan 2019 15:11:46 -0500 Subject: Safe unicode handling --- src/rebar_file_utils.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rebar_file_utils.erl b/src/rebar_file_utils.erl index 5b6164a..0e0dfe3 100644 --- a/src/rebar_file_utils.erl +++ b/src/rebar_file_utils.erl @@ -195,9 +195,9 @@ cp_r(Sources, Dest) -> % On darwin the following cp command will cp everything inside % target vs target and everything inside, so we chop the last char % off if it is a '/' - Source = case {Os == darwin, lists:last(SourceStr) == 47} of + Source = case {Os == darwin, lists:last(SourceStr) == $/} of {true, true} -> - string:sub_string(SourceStr, 1, length(SourceStr) - 1); + rebar_string:trim(SourceStr, trailing, "/"); {true, false} -> SourceStr; {false, _} -> -- cgit v1.1