Remove more OOM error handling code

From the functions:

 - ExpandBufnames
 - buf_modname()
 - do_autocmd_event()
 - ff_create_stack_element()
 - ff_get_visited_list()
 - ins_complete()
 - msg_show_console_dialog()
 - prt_find_resource()
 - vim_findfile_init()

TODO: refactor msg_show_console_dialog() to make sure it doesn't ever return
NULL.
This commit is contained in:
Felipe Oliveira Carvalho
2014-04-04 14:24:13 -03:00
committed by Thiago de Arruda
parent 3fcdb2ab29
commit 86279cefae
7 changed files with 21 additions and 58 deletions

View File

@@ -4345,8 +4345,6 @@ static int ins_complete(int c)
/* we need up to 2 extra chars for the prefix */
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
compl_length) + 2);
if (compl_pattern == NULL)
return FAIL;
if (!vim_iswordp(line + compl_col)
|| (compl_col > 0
&& (
@@ -4392,16 +4390,12 @@ static int ins_complete(int c)
* alloc(7) is enough -- Acevedo
*/
compl_pattern = alloc(7);
if (compl_pattern == NULL)
return FAIL;
STRCPY((char *)compl_pattern, "\\<");
(void)quote_meta(compl_pattern + 2, line + compl_col, 1);
STRCAT((char *)compl_pattern, "\\k");
} else {
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
compl_length) + 2);
if (compl_pattern == NULL)
return FAIL;
STRCPY((char *)compl_pattern, "\\<");
(void)quote_meta(compl_pattern + 2, line + compl_col,
compl_length);