Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Problem:    'backupskip' default doesn't work for Mac.
Solution:   Use "/private/tmp". (Rainer Müller, closes #2793)
  • Loading branch information
brammool committed Apr 12, 2018
1 parent 527dec3 commit b8e22a0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runtime/doc/options.txt
Expand Up @@ -1087,7 +1087,9 @@ A jump table for the options with a short description can be found at |Q_op|.
< Use 'backupdir' to put the backup in a different directory.

*'backupskip'* *'bsk'*
'backupskip' 'bsk' string (default: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*")
'backupskip' 'bsk' string (default: "$TMPDIR/*,$TMP/*,$TEMP/*"
Unix: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*"
Mac: "/private/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*")
global
{not in Vi}
{not available when compiled without the |+wildignore|
Expand Down
4 changes: 4 additions & 0 deletions src/option.c
Expand Up @@ -3367,7 +3367,11 @@ set_init_1(int clean_arg)
mustfree = FALSE;
# ifdef UNIX
if (*names[n] == NUL)
# ifdef MACOS_X
p = (char_u *)"/private/tmp";
# else
p = (char_u *)"/tmp";
# endif
else
# endif
p = vim_getenv((char_u *)names[n], &mustfree);
Expand Down
16 changes: 16 additions & 0 deletions src/testdir/test_options.vim
Expand Up @@ -332,3 +332,19 @@ func Test_set_indentexpr()
call assert_equal('', &indentexpr)
bwipe!
endfunc

func Test_backupskip()
if has("mac")
call assert_match('/private/tmp/\*', &bsk)
elseif has("unix")
call assert_match('/tmp/\*', &bsk)
endif

let bskvalue = substitute(&bsk, '\\', '/', 'g')
for var in ['$TEMPDIR', '$TMP', '$TEMP']
if exists(var)
let varvalue = substitute(expand(var), '\\', '/', 'g')
call assert_match(varvalue . '.\*', bskvalue)
endif
endfor
endfunc
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -762,6 +762,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1704,
/**/
1703,
/**/
Expand Down

0 comments on commit b8e22a0

Please sign in to comment.