changeset 6255:c0d93d67572b v7.4.462

updated for version 7.4.462 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)
author Bram Moolenaar <bram@vim.org>
date Mon, 29 Sep 2014 17:15:18 +0200
parents 1b74025a66e7
children c7e6e4089fb3
files src/option.c src/version.c
diffstat 2 files changed, 17 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/option.c
+++ b/src/option.c
@@ -5742,15 +5742,21 @@ did_set_string_option(opt_idx, varp, new
 	    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)
-	{
-	    /* Must have exactly one of "auto", "yes"  and "no". */
-	    (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE);
-	    errmsg = e_invarg;
+	if ((opt_flags & OPT_LOCAL) && *bkc == NUL)
+	    /* make the local value empty: use the global value */
+	    *flags = 0;
+	else
+	{
+	    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;
+	    }
 	}
     }
 
--- 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,