Hi, Bram,
The attached one-line patch alters the behaviour of retrieving the 'key'
option.
Rather than always returning "*****" it returns the empty string if 'key' is
empty. While still protecting any key that is used, this is useful to be able
to
determine whether or not a file is encrypted, so you can, for example, disable
swap files with an autocommand depending on whether a file is encrypted or not.
It
shouldn't cause any compatibility issues, as no programmer should have relied
on
'key' always being "*****"; they could just hard code "*****" themselves!
Would you be able to include this?
Cheers,
Ben.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
diff -r 0be0bfb9419f src/option.c
--- a/src/option.c Tue Jun 10 01:54:39 2008 +1000
+++ b/src/option.c Fri Jun 13 03:51:27 2008 +1000
@@ -8350,7 +8350,7 @@
{
#ifdef FEAT_CRYPT
/* never return the value of the crypt key */
- if ((char_u **)varp == &curbuf->b_p_key)
+ if ((char_u **)varp == &curbuf->b_p_key && **(char **)(varp)!=0)
*stringval = vim_strsave((char_u *)"*****");
else
#endif