瀏覽代碼

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.
pull/1504/head
Vlad Dumitrescu 8 年之前
committed by GitHub
父節點
當前提交
c6eea2bd46
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      src/rebar_utils.erl

+ 1
- 1
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) ->

Loading…
取消
儲存