diff options
author | ckelsel <ckelsel@hotmail.com> | 2017-09-24 11:54:40 +0800 |
---|---|---|
committer | ckelsel <ckelsel@hotmail.com> | 2017-09-24 12:49:16 +0800 |
commit | cd13c24427a3191c7383b76a0bf9467bee2736e3 (patch) | |
tree | 59451c6ee4c5f42500d6db549e923677fc0f5889 /src/nvim/option.c | |
parent | d2eba872fb80ec9ace3a244aa706e55c82a48e83 (diff) | |
download | rneovim-cd13c24427a3191c7383b76a0bf9467bee2736e3.tar.gz rneovim-cd13c24427a3191c7383b76a0bf9467bee2736e3.tar.bz2 rneovim-cd13c24427a3191c7383b76a0bf9467bee2736e3.zip |
vim-patch:8.0.0102
Problem: Cannot set 'dictionary' to a path.
Solution: Allow for slash and backslash. Add a test (partly by Daisuke
Suzuki, closes vim/vim#1279, closes vim/vim#1284)
https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index ae1a2b1b24..6ed4989a4c 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -242,6 +242,7 @@ typedef struct vimoption { #define P_NO_DEF_EXP 0x8000000U ///< Do not expand default value. #define P_RWINONLY 0x10000000U ///< only redraw current window +#define P_NDNAME 0x20000000U ///< only normal dir name chars allowed #define HIGHLIGHT_INIT \ "8:SpecialKey,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText," \ @@ -2454,11 +2455,13 @@ did_set_string_option ( if ((secure || sandbox != 0) && (options[opt_idx].flags & P_SECURE)) { errmsg = e_secure; - } else if ((options[opt_idx].flags & P_NFNAME) - && vim_strpbrk(*varp, (char_u *)"/\\*?[|;&<>\r\n") != NULL) { - // Check for a "normal" file name in some options. Disallow a path - // separator (slash and/or backslash), wildcards and characters that are - // often illegal in a file name. + } else if ((((options[opt_idx].flags & P_NFNAME) + && vim_strpbrk(*varp, (char_u *)"/\\*?[|;&<>\r\n") != NULL)) + || ((options[opt_idx].flags & P_NDNAME) + && vim_strpbrk(*varp, (char_u *)"*?[|;&<>\r\n") != NULL)) { + // Check for a "normal" directory or file name in some options. Disallow a + // path separator (slash and/or backslash), wildcards and characters that + // are often illegal in a file name. errmsg = e_invarg; } /* 'backupcopy' */ |