aboutsummaryrefslogtreecommitdiff
path: root/autoload/shebang_create_exec.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/shebang_create_exec.vim')
-rw-r--r--autoload/shebang_create_exec.vim6
1 files changed, 3 insertions, 3 deletions
diff --git a/autoload/shebang_create_exec.vim b/autoload/shebang_create_exec.vim
index 1ce68e3..60d2276 100644
--- a/autoload/shebang_create_exec.vim
+++ b/autoload/shebang_create_exec.vim
@@ -70,10 +70,10 @@ function! s:MakeExecutable(filename) abort
else
" We'll need to fork to chmod(1); escape the filename safely, using
- " shellescape() if we've got it
- let l:filename_escaped = exists('*shellescape')
+ " 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)