diff options
Diffstat (limited to 'vim/plugin/auto_backupdir.vim')
-rw-r--r-- | vim/plugin/auto_backupdir.vim | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/vim/plugin/auto_backupdir.vim b/vim/plugin/auto_backupdir.vim index d15c3150..17a1a646 100644 --- a/vim/plugin/auto_backupdir.vim +++ b/vim/plugin/auto_backupdir.vim @@ -18,7 +18,7 @@ else " This is imperfect in that it will break if you have a backslashed comma in " the first component of your &runtimepath, but if you're doing that, you " probably already have way bigger problems - let s:backupdir + let s:backupdir \ = strpart(&runtimepath, 0, stridx(&runtimepath, ',')) \ . '/backup' endif @@ -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 |