diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2019-01-23 15:11:46 -0500 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2019-01-23 15:11:46 -0500 |
commit | 67fef1fa2639e9565eb354234a389ad3b6501592 (patch) | |
tree | de71ba1fcd19aa79eb620f764ea48adbd91af79a | |
parent | 92783945d5882ec91d739dcc6da9899d296f7b13 (diff) |
Safe unicode handling
-rw-r--r-- | src/rebar_file_utils.erl | 4 |
1 files changed, 2 insertions, 2 deletions
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, _} -> |