summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Dumitrescu <vladdu55@gmail.com>2017-03-04 17:35:37 +0100
committerGitHub <noreply@github.com>2017-03-04 17:35:37 +0100
commitc6eea2bd468cad56220e7f7c63c4689fe8328789 (patch)
tree317c418cd8ce135e8768cce6fec842876203c182
parent3a5f7091b2bc46ece7ce2ac86eb5269eea1863ae (diff)
rebar_utils:escape_chars handles quotes
rebar_file_utils:cp_r uses rebar_utils:escape_chars to ensure that the file names are safe to use, but it doesn't escape double and single quotes. If the file name includes those characters, they disappear when the shell processes them and we get "file not found" errors. The main culprit here is eunit, that creates reports whose names are `TEST-file_"myfile.app".xml`, and I wish it didn't but I think escape_chars should still do its job all the way.
-rw-r--r--src/rebar_utils.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index c357e94..c684e2d 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -857,7 +857,7 @@ url_append_path(Url, ExtraPath) ->
escape_chars(Str) when is_atom(Str) ->
escape_chars(atom_to_list(Str));
escape_chars(Str) ->
- re:replace(Str, "([ ()?`!$&;])", "\\\\&", [global, {return, list}]).
+ re:replace(Str, "([ ()?`!$&;\"\'])", "\\\\&", [global, {return, list}]).
%% "escape inside these"
escape_double_quotes(Str) ->