From 9a0d3b1514f1fb8620726bf08f6e574566d6bcde Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 13 Nov 2017 22:09:38 +1300 Subject: Check for shellescape() function before using it It was added in patch 111 for Vim 7.0. --- vim/plugin/auto_backupdir.vim | 14 ++++++++------ vim/plugin/auto_swapdir.vim | 14 ++++++++------ vim/plugin/auto_undodir.vim | 14 ++++++++------ 3 files changed, 24 insertions(+), 18 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 diff --git a/vim/plugin/auto_swapdir.vim b/vim/plugin/auto_swapdir.vim index b5f9ce3a..52ccbf11 100644 --- a/vim/plugin/auto_swapdir.vim +++ b/vim/plugin/auto_swapdir.vim @@ -32,12 +32,14 @@ if !isdirectory(expand(s:swapdir)) " 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:swapdir)) - elseif has('win32') || has('win64') - silent! execute '!mkdir ' - \ . shellescape(expand(s:swapdir)) + elseif has('*shellescape') + if has('unix') + silent! execute '!mkdir -m 0700 -p ' + \ . shellescape(expand(s:swapdir)) + elseif has('win32') || has('win64') + silent! execute '!mkdir ' + \ . shellescape(expand(s:swapdir)) + endif endif endif diff --git a/vim/plugin/auto_undodir.vim b/vim/plugin/auto_undodir.vim index cf8d896a..c43e62c9 100644 --- a/vim/plugin/auto_undodir.vim +++ b/vim/plugin/auto_undodir.vim @@ -35,12 +35,14 @@ if !isdirectory(expand(s:undodir)) " 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:undodir)) - elseif has('win32') || has('win64') - silent! execute '!mkdir ' - \ . shellescape(expand(s:undodir)) + elseif has('*shellescape') + elseif has('unix') + silent! execute '!mkdir -m 0700 -p ' + \ . shellescape(expand(s:undodir)) + elseif has('win32') || has('win64') + silent! execute '!mkdir ' + \ . shellescape(expand(s:undodir)) + endif endif endif -- cgit v1.2.3