rename EscapeArg to SanitizeArg

This commit is contained in:
Alan Hamlett 2018-04-03 23:00:15 -07:00
parent c9f0c2590d
commit d692e95e6e

View file

@ -221,8 +221,10 @@ let s:VERSION = '7.0.7'
return expand("%:p") return expand("%:p")
endfunction endfunction
function! s:EscapeArg(arg) function! s:SanitizeArg(arg)
return substitute(shellescape(a:arg), '!', '\\!', '') let sanitized = shellescape(a:arg)
let sanitized = substitute(sanitized, '!', '\\!', '')
return sanitized
endfunction endfunction
function! s:JsonEscape(str) function! s:JsonEscape(str)
@ -232,7 +234,7 @@ let s:VERSION = '7.0.7'
function! s:JoinArgs(args) function! s:JoinArgs(args)
let safeArgs = [] let safeArgs = []
for arg in a:args for arg in a:args
let safeArgs = safeArgs + [s:EscapeArg(arg)] let safeArgs = safeArgs + [s:SanitizeArg(arg)]
endfor endfor
return join(safeArgs, ' ') return join(safeArgs, ' ')
endfunction endfunction