summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-08 22:59:25 +0100
committerw0rp <devw0rp@gmail.com>2017-05-08 22:59:25 +0100
commit6ea00af6895e111320a2047f43f94792a46b6cea (patch)
tree8a941fa08834e5dd512f3136b3c9b836ebf1b3d4 /autoload
parent28c6ec9cad3064966ff70c9da95c96364118eb57 (diff)
downloadale-6ea00af6895e111320a2047f43f94792a46b6cea.zip
#540 Fix shell escaping pretty much everywhere
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/engine.vim6
-rw-r--r--autoload/ale/path.vim2
2 files changed, 4 insertions, 4 deletions
diff --git a/autoload/ale/engine.vim b/autoload/ale/engine.vim
index 047392d0..339f7ee9 100644
--- a/autoload/ale/engine.vim
+++ b/autoload/ale/engine.vim
@@ -480,14 +480,14 @@ function! ale#engine#FormatCommand(buffer, command) abort
" file.
if l:command =~# '%s'
let l:filename = fnamemodify(bufname(a:buffer), ':p')
- let l:command = substitute(l:command, '%s', '\=fnameescape(l:filename)', 'g')
+ let l:command = substitute(l:command, '%s', '\=shellescape(l:filename)', 'g')
endif
if l:command =~# '%t'
" Create a temporary filename, <temp_dir>/<original_basename>
" The file itself will not be created by this function.
let l:temporary_file = s:TemporaryFilename(a:buffer)
- let l:command = substitute(l:command, '%t', '\=fnameescape(l:temporary_file)', 'g')
+ let l:command = substitute(l:command, '%t', '\=shellescape(l:temporary_file)', 'g')
endif
" Finish formatting so %% becomes %.
@@ -529,7 +529,7 @@ function! s:RunJob(options) abort
" in the shell. We'll write out the file to a temporary file,
" and then read it back in, in the shell.
let l:temporary_file = s:TemporaryFilename(l:buffer)
- let l:command = l:command . ' < ' . fnameescape(l:temporary_file)
+ let l:command = l:command . ' < ' . shellescape(l:temporary_file)
endif
if s:CreateTemporaryFileForJob(l:buffer, l:temporary_file)
diff --git a/autoload/ale/path.vim b/autoload/ale/path.vim
index 0ea13351..26da9e24 100644
--- a/autoload/ale/path.vim
+++ b/autoload/ale/path.vim
@@ -47,7 +47,7 @@ endfunction
" Output 'cd <directory> && '
" This function can be used changing the directory for a linter command.
function! ale#path#CdString(directory) abort
- return 'cd ' . fnameescape(a:directory) . ' && '
+ return 'cd ' . shellescape(a:directory) . ' && '
endfunction
" Output 'cd <buffer_filename_directory> && '