diff options
author | Bram Moolenaar <bram@vim.org> | 2014-09-29 17:15:18 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2014-09-29 17:15:18 +0200 |
commit | b95075251a31947c7abae6763fb9eaa7c128e37a (patch) | |
tree | 02101112407f34e4413bd26df80be9f771f7de13 | |
parent | c8b5c26c0570007a6267388b17f623f52f13e78e (diff) | |
download | vim-b95075251a31947c7abae6763fb9eaa7c128e37a.tar.gz |
Problem: Setting the local value of 'backupcopy' empty gives an error.
(Peter Mattern)
Solution: When using an empty value set the flags to zero. (Hirohito
Higashi)
-rw-r--r-- | src/option.c | 22 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/option.c b/src/option.c index af9fb506..5e8e95a6 100644 --- a/src/option.c +++ b/src/option.c @@ -5742,15 +5742,21 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf, flags = &curbuf->b_bkc_flags; } - if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK) - errmsg = e_invarg; - if ((((int)*flags & BKC_AUTO) != 0) - + (((int)*flags & BKC_YES) != 0) - + (((int)*flags & BKC_NO) != 0) != 1) + if ((opt_flags & OPT_LOCAL) && *bkc == NUL) + /* make the local value empty: use the global value */ + *flags = 0; + else { - /* Must have exactly one of "auto", "yes" and "no". */ - (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE); - errmsg = e_invarg; + if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK) + errmsg = e_invarg; + if ((((int)*flags & BKC_AUTO) != 0) + + (((int)*flags & BKC_YES) != 0) + + (((int)*flags & BKC_NO) != 0) != 1) + { + /* Must have exactly one of "auto", "yes" and "no". */ + (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE); + errmsg = e_invarg; + } } } diff --git a/src/version.c b/src/version.c index d0847ad7..579e0f9e 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 462, +/**/ 461, /**/ 460, |