diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-12 19:05:48 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-12 19:05:48 +0200 |
commit | 06e2c81f6d213d197aa60019b33a263cd5176d68 (patch) | |
tree | 543715f5f1781b192aae5ce3bbd5c9d2ee875a71 | |
parent | 202d982b36d87cf91d992bd7e30d3223bdc72cd9 (diff) |
patch 8.1.1519: 'backupskip' may contain duplicatesv8.1.1519
Problem: 'backupskip' may contain duplicates.
Solution: Add the P_NODUP flag. (Tom Ryder)
-rw-r--r-- | src/option.c | 5 | ||||
-rw-r--r-- | src/testdir/test_options.vim | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/option.c b/src/option.c index 2146be7ef6..2d22c4c973 100644 --- a/src/option.c +++ b/src/option.c @@ -616,7 +616,7 @@ static struct vimoption options[] = (char_u *)"~", #endif (char_u *)0L} SCTX_INIT}, - {"backupskip", "bsk", P_STRING|P_VI_DEF|P_ONECOMMA, + {"backupskip", "bsk", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_WILDIGN (char_u *)&p_bsk, PV_NONE, {(char_u *)"", (char_u *)0L} @@ -4807,7 +4807,8 @@ do_set( * hex numbers. */ vim_str2nr(arg, NULL, &i, STR2NR_ALL, &value, NULL, 0, TRUE); - if (i == 0 || (arg[i] != NUL && !VIM_ISWHITE(arg[i]))) + if (i == 0 || (arg[i] != NUL + && !VIM_ISWHITE(arg[i]))) { errmsg = N_("E521: Number required after ="); goto skip; diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 13de719342..9d3065d159 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -419,6 +419,15 @@ func Test_backupskip() call assert_true(found, var . ' (' . varvalue . ') not in option bsk: ' . &bsk) endif endfor + + " Duplicates should be filtered out (option has P_NODUP) + let backupskip = &backupskip + set backupskip= + set backupskip+=/test/dir + set backupskip+=/other/dir + set backupskip+=/test/dir + call assert_equal('/test/dir,/other/dir', &backupskip) + let &backupskip = backupskip endfunc func Test_copy_winopt() diff --git a/src/version.c b/src/version.c index 7432f70e03..5c41f4fbb0 100644 --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1519, +/**/ 1518, /**/ 1517, |