mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
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:

committed by
Thiago de Arruda

parent
3fcdb2ab29
commit
86279cefae
@@ -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);
|
||||
|
Reference in New Issue
Block a user