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.
diff --git a/src/option.c b/src/option.c
index 62556b6..f928b3b 100644
--- a/src/option.c
+++ b/src/option.c
@@ -6163,6 +6163,14 @@
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