updated for version 7.4.336 v7.4.336
authorBram Moolenaar <Bram@vim.org>
Wed, 25 Jun 2014 09:48:54 +0000 (11:48 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 25 Jun 2014 09:48:54 +0000 (11:48 +0200)
Problem:    Setting 'history' to a big value causes out-of-memory errors.
Solution:   Limit the value to 10000. (Hirohito Higashi)

runtime/doc/options.txt
src/option.c
src/version.c

index 71280f204a214a24391b838d5fe9abea5c74002e..6a2ad89a399bbc7b3d8a41a62709e5192397bd73 100644 (file)
@@ -3920,12 +3920,13 @@ A jump table for the options with a short description can be found at |Q_op|.
        NOTE: This option is reset when 'compatible' is set.
 
                                                *'history'* *'hi'*
-'history' 'hi'         number  (Vim default: 20, Vi default: 0)
+'history' 'hi'         number  (Vim default: 50, Vi default: 0)
                        global
                        {not in Vi}
        A history of ":" commands, and a history of previous search patterns
-       are remembered.  This option decides how many entries may be stored in
+       is remembered.  This option decides how many entries may be stored in
        each of these histories (see |cmdline-editing|).
+       The maximum value is 10000.
        NOTE: This option is set to the Vi default value when 'compatible' is
        set and to the Vim default value when 'compatible' is reset.
 
index a36f8c0a01f5f5260d5514fb07854290d69ac76c..f2f232e357603e629bd35c3e32ec92db47967bab 100644 (file)
@@ -1392,7 +1392,7 @@ static struct vimoption
                            SCRIPTID_INIT},
     {"history",            "hi",   P_NUM|P_VIM,
                            (char_u *)&p_hi, PV_NONE,
-                           {(char_u *)0L, (char_u *)20L} SCRIPTID_INIT},
+                           {(char_u *)0L, (char_u *)50L} SCRIPTID_INIT},
     {"hkmap",      "hk",   P_BOOL|P_VI_DEF|P_VIM,
 #ifdef FEAT_RIGHTLEFT
                            (char_u *)&p_hkmap, PV_NONE,
@@ -8595,6 +8595,11 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
        errmsg = e_positive;
        p_hi = 0;
     }
+    else if (p_hi > 10000)
+    {
+       errmsg = e_invarg;
+       p_hi = 10000;
+    }
     if (p_re < 0 || p_re > 2)
     {
        errmsg = e_invarg;
index 1fc748c400d21e061e3391d95e688cc124367340..bb63095f10b871639c3d4fb4fdd9e4f1ed0ea0ad 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    336,
 /**/
     335,
 /**/