aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-29 01:29:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-29 01:29:12 +1200
commit9caae053c0cf15aed518813eca00d14294df3986 (patch)
treeebc82c115efdee451f824d9bca06a17491be33f6
parent238c3b353aa004d7fa1ba4316ac3ae0cbf9dd834 (diff)
parentd6d54a9db5f87c0fee598e3a75f0fcdc5d1d3025 (diff)
downloadvim-shebang-create-exec-9caae053c0cf15aed518813eca00d14294df3986.tar.gz
vim-shebang-create-exec-9caae053c0cf15aed518813eca00d14294df3986.zip
Merge branch 'hotfix/v1.0.1' into develop
* hotfix/v1.0.1: Correct manual UNIX shellescape() implementation Improve clarity of comment Remove unneeded variable scoping
-rw-r--r--VERSION2
-rw-r--r--autoload/shebang_create_exec.vim6
2 files changed, 4 insertions, 4 deletions
diff --git a/VERSION b/VERSION
index 3eefcb9..7dea76e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.0
+1.0.1
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)