aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-29 01:27:15 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-29 01:28:24 +1200
commit6b5d1aba3b0f84b48dfbb9d638b219854ecada2a (patch)
treee3aee45575b6582481a6940a44a4920a78beb2b0
parentImprove clarity of comment (diff)
downloadvim-shebang-create-exec-6b5d1aba3b0f84b48dfbb9d638b219854ecada2a.tar.gz
vim-shebang-create-exec-6b5d1aba3b0f84b48dfbb9d638b219854ecada2a.zip
Correct manual UNIX shellescape() implementation
-rw-r--r--autoload/shebang_create_exec.vim2
1 files changed, 1 insertions, 1 deletions
diff --git a/autoload/shebang_create_exec.vim b/autoload/shebang_create_exec.vim
index 8ae659e..60d2276 100644
--- a/autoload/shebang_create_exec.vim
+++ b/autoload/shebang_create_exec.vim
@@ -73,7 +73,7 @@ function! s:MakeExecutable(filename) abort
" shellescape() if we've got it, or manual UNIX sh quoting if not
let filename_escaped = exists('*shellescape')
\ ? shellescape(filename)
- \ : '''' . escape(filename, '''') . ''''
+ \ : "'" . substitute(filename, "'", "'\\''", 'g') . "'"
" Try to make the file executable with a fork to chmod(1)
call system('chmod +x '.filename_escaped)