Hirohito Higashi wrote:

> Hi Bram and Vim developers,
> 
> How to reproduce:
> - start Vim and set 'hi' option to huge value.
>   $ vim -N -u NONE -c "set history=100000000"
> - Input colon.
>   :
> 
> Occurred pattern #1
> - OS get stuck (Verrry slow response)
> 
> Occurred pattern #2
> - get 'E342'
>   E342: Out of memory!  (allocating 1600000000 bytes)
> - And Vim can not terminated by ':q'.
>   (I know terminated ZQ or ZZ)
> 
> 
> Investigation for #1
> - `:` typed after 'hi'option changed, call init_history().
>   This function is call lalloc() by huge value.
>   (p_hi * 16 = 1600000000)
>   I think we should have an upper limit to 'hi'. (10000 in Patch#1)
> 
> Investigation for #2
> - If an error occurs after I press the colon, The command line
>   is not interpreted in the usual way.
>   [ea.skip ... ex_docmd.c:1972]
>   So, if get an error in init_history() and command-line
>   character is `:`, Then I clear the did_emsg.
> 
> 
> I attached two patches.
> Please check these.

Thanks.  Yeah, this code was written with a small number of history
entries in mind.  I think your solution is good enough.

While at it, let's increase the default value from 20 to 50.

Not being able to exit because of an error is a problem as well.
Thanks for fixing that too.  However, there might be other causes for an
error message, and we don't want any of them to cause a problem.
Thus let's just reset did_emsg before the user starts typing.

> Thank you for reading my crazy English :-)

It's not too bad.


-- 
This is the polymorph virus!  Follow these instructions carefully:
1. Send this message to everybody you know.
2. Format your harddisk.
Thank you for your cooperation in spreading the most powerful virus ever!

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui