diff src/option.c @ 2184:5028c4d6d825 vim73

Fixed encryption big/little endian test. Use uint32_t to avoid crash on 64 bit machines. Added error numbers for Blowfish errors. Fixed the tiny version not building.
author Bram Moolenaar <bram@vim.org>
date Mon, 17 May 2010 20:32:55 +0200
parents f60a0c9cbe6c
children f8222d1f9a73
line wrap: on
line diff
--- a/src/option.c
+++ b/src/option.c
@@ -278,7 +278,9 @@ static char_u	*p_cino;
 #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
 static char_u	*p_cinw;
 #endif
+#ifdef FEAT_CRYPT
 static long	p_cm;
+#endif
 #ifdef FEAT_COMMENTS
 static char_u	*p_com;
 #endif
@@ -837,7 +839,11 @@ static struct vimoption
 			    {(char_u *)CPO_VI, (char_u *)CPO_VIM}
 			    SCRIPTID_INIT},
     {"cryptmethod", "cm",   P_NUM|P_VI_DEF|P_VIM,
+#ifdef FEAT_CRYPT
 			    (char_u *)&p_cm, PV_CM,
+#else
+			    (char_u *)NULL, PV_NONE,
+#endif
 			    {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
     {"cscopepathcomp", "cspc", P_NUM|P_VI_DEF|P_VIM,
 #ifdef FEAT_CSCOPE
@@ -7875,6 +7881,7 @@ set_num_option(opt_idx, varp, value, err
 
 #endif
 
+#ifdef FEAT_CRYPT
     else if (pp == &curbuf->b_p_cm)
     {
 	if (curbuf->b_p_cm < 0)
@@ -7890,6 +7897,7 @@ set_num_option(opt_idx, varp, value, err
 	if (curbuf->b_p_cm > 0 && blowfish_self_test() == FAIL)
 	    curbuf->b_p_cm = 0;
     }
+#endif
 
 #ifdef FEAT_WINDOWS
     /* (re)set last window status line */
@@ -9307,7 +9315,9 @@ get_varp(p)
 	case PV_CINK:	return (char_u *)&(curbuf->b_p_cink);
 	case PV_CINO:	return (char_u *)&(curbuf->b_p_cino);
 #endif
+#ifdef FEAT_CRYPT
 	case PV_CM:	return (char_u *)&(curbuf->b_p_cm);
+#endif
 #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
 	case PV_CINW:	return (char_u *)&(curbuf->b_p_cinw);
 #endif