aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-29 01:28:46 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-29 01:28:46 +1200
commit7af26cb8b9b4de215d9c03a5454575d7f1ae01aa (patch)
treeebc82c115efdee451f824d9bca06a17491be33f6
parentMerge branch 'release/v1.0.0' (diff)
parentBump VERSION (diff)
downloadvim-shebang-create-exec-7af26cb8b9b4de215d9c03a5454575d7f1ae01aa.tar.gz
vim-shebang-create-exec-7af26cb8b9b4de215d9c03a5454575d7f1ae01aa.zip
Merge branch 'hotfix/v1.0.1'v1.0.1
* 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)