diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-13 22:09:38 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-13 22:09:38 +1300 |
commit | 9a0d3b1514f1fb8620726bf08f6e574566d6bcde (patch) | |
tree | e35ba000f1c3ab9082dc927fd5380e11994df56a /vim/plugin/auto_backupdir.vim | |
parent | Merge branch 'feature/vim-ftdetect' into develop (diff) | |
download | dotfiles-9a0d3b1514f1fb8620726bf08f6e574566d6bcde.tar.gz dotfiles-9a0d3b1514f1fb8620726bf08f6e574566d6bcde.zip |
Check for shellescape() function before using it
It was added in patch 111 for Vim 7.0.
Diffstat (limited to 'vim/plugin/auto_backupdir.vim')
-rw-r--r-- | vim/plugin/auto_backupdir.vim | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/vim/plugin/auto_backupdir.vim b/vim/plugin/auto_backupdir.vim index d15c3150..58e5683e 100644 --- a/vim/plugin/auto_backupdir.vim +++ b/vim/plugin/auto_backupdir.vim @@ -32,12 +32,14 @@ if !isdirectory(expand(s:backupdir)) " Failing that, use an OS-dependent command " (Fortunately, Unix and Windows are the only OS types in the world) - elseif has('unix') - silent! execute '!mkdir -m 0700 -p ' - \ . shellescape(expand(s:backupdir)) - elseif has('win32') || has('win64') - silent! execute '!mkdir ' - \ . shellescape(expand(s:backupdir)) + elseif has('*shellescape') + if has('unix') + silent! execute '!mkdir -m 0700 -p ' + \ . shellescape(expand(s:backupdir)) + elseif has('win32') || has('win64') + silent! execute '!mkdir ' + \ . shellescape(expand(s:backupdir)) + endif endif endif |