diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-04-07 22:28:33 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-11 12:57:59 -0300 |
commit | f6b0e335e1f638e3c2d97e6886976d28d3798c32 (patch) | |
tree | c44159f894a036baa9e880f53cf3a2c3ba36adb7 /src/ex_docmd.c | |
parent | 457bb2615154946d273d75e07f5d5a936f50ede0 (diff) | |
download | rneovim-f6b0e335e1f638e3c2d97e6886976d28d3798c32.tar.gz rneovim-f6b0e335e1f638e3c2d97e6886976d28d3798c32.tar.bz2 rneovim-f6b0e335e1f638e3c2d97e6886976d28d3798c32.zip |
Remove OOM error handling code after ga_grow() calls
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index a5cd1863a0..a5d4b3bd2f 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -1,4 +1,4 @@ -/* vi:set ts=8 sts=4 sw=4: +/* vi:set ts=2 sts=2 sw=2: * * VIM - Vi IMproved by Bram Moolenaar * @@ -1179,8 +1179,7 @@ static char_u *get_loop_line(int c, void *cookie, int indent) */ static int store_loop_line(garray_T *gap, char_u *line) { - if (ga_grow(gap, 1) == FAIL) - return FAIL; + ga_grow(gap, 1); ((wcmd_T *)(gap->ga_data))[gap->ga_len].line = vim_strsave(line); ((wcmd_T *)(gap->ga_data))[gap->ga_len].lnum = sourcing_lnum; ++gap->ga_len; @@ -4361,8 +4360,8 @@ static int uc_add_command(char_u *name, size_t name_len, char_u *rep, long argt, /* Extend the array unless we're replacing an existing command */ if (cmp != 0) { - if (ga_grow(gap, 1) != OK) - goto fail; + ga_grow(gap, 1); + if ((p = vim_strnsave(name, (int)name_len)) == NULL) goto fail; @@ -5868,7 +5867,8 @@ void alist_set(alist_T *al, int count, char_u **files, int use_curbuf, int *fnum int i; alist_clear(al); - if (ga_grow(&al->al_ga, count) == OK) { + ga_grow(&al->al_ga, count); + { for (i = 0; i < count; ++i) { if (got_int) { /* When adding many buffers this can take a long time. Allow @@ -5887,8 +5887,8 @@ void alist_set(alist_T *al, int count, char_u **files, int use_curbuf, int *fnum ui_breakcheck(); } vim_free(files); - } else - FreeWild(count, files); + } + if (al == &global_alist) arg_had_last = FALSE; } |