diff src/fileio.c @ 2410:8f6106dd3d12 vim73

Fix: editing a not encrypted file after a crypted file messed up reading the text from an undo file.
author Bram Moolenaar <bram@vim.org>
date Sun, 25 Jul 2010 16:05:19 +0200
parents a3aca345aafa
children 88751831fa0a
line wrap: on
line diff
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2953,7 +2953,7 @@ check_for_cryptkey(cryptkey, ptr, sizep,
     }
     /* When starting to edit a new file which does not have encryption, clear
      * the 'key' option, except when starting up (called with -x argument) */
-    else if (newfile && *curbuf->b_p_key && !starting)
+    else if (newfile && *curbuf->b_p_key != NUL && !starting)
 	set_option_value((char_u *)"key", 0L, (char_u *)"", OPT_LOCAL);
 
     return cryptkey;