diff src/option.c @ 6130:86fb698a38d5 v7.4.403

updated for version 7.4.403 Problem: Valgrind reports errors when running test 72. (Dominique Pelle) Solution: Reset the local 'cryptmethod' option before storing the seed. Set the seed in the memfile even when there is no block0 yet.
author Bram Moolenaar <bram@vim.org>
date Wed, 13 Aug 2014 21:58:28 +0200
parents 18ac55444b37
children e60327caf909
line wrap: on
line diff
--- a/src/option.c
+++ b/src/option.c
@@ -6163,6 +6163,14 @@ did_set_string_option(opt_idx, varp, new
 		p_cm = vim_strsave((char_u *)"zip");
 		new_value_alloced = TRUE;
 	    }
+	    /* When using ":set cm=name" the local value is going to be empty.
+	     * Do that here, otherwise the crypt functions will still use the
+	     * local value. */
+	    if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
+	    {
+		free_string_option(curbuf->b_p_cm);
+		curbuf->b_p_cm = empty_option;
+	    }
 
 	    /* Need to update the swapfile when the effective method changed.
 	     * Set "s" to the effective old value, "p" to the effective new