Problem: Checking returned value of ga_grow() is inconsistent.
Solution: Check for FAIL instaed of "not OK". (Yegappan Lakshmanan,
closes #11897)
}
// Add a new digraph to the table.
- if (ga_grow(&user_digraphs, 1) != OK)
+ if (ga_grow(&user_digraphs, 1) == FAIL)
return;
dp = (digr_T *)user_digraphs.ga_data + user_digraphs.ga_len;
len = (int)STRLEN(value); // Append the entire string
else
len = value_len; // Append only "value_len" characters
- if (ga_grow(&redir_execute_ga, len) != OK)
+ if (ga_grow(&redir_execute_ga, len) == FAIL)
return;
mch_memmove((char *)redir_execute_ga.ga_data
i = (int)(fp - (fold_T *)gap->ga_data);
}
- if (ga_grow(gap, 1) != OK)
+ if (ga_grow(gap, 1) == FAIL)
return;
fp = (fold_T *)gap->ga_data + i;
{
fold_T *fp;
- if (ga_grow(gap, 1) != OK)
+ if (ga_grow(gap, 1) == FAIL)
return FAIL;
fp = (fold_T *)gap->ga_data + i;
if (gap->ga_len > 0 && i < gap->ga_len)
got_int = FALSE;
while (c1 != NUL && !aborted)
{
- if (ga_grow(&line_ga, 32) != OK)
+ if (ga_grow(&line_ga, 32) == FAIL)
{
aborted = TRUE;
break;
b = i;
}
- if (ga_grow(&langmap_mapga, 1) != OK)
+ if (ga_grow(&langmap_mapga, 1) == FAIL)
return; // out of memory
// insert new entry at position "a"
size_t lkey = wcslen(wkey);
size_t lval = wcslen(wval);
- if (ga_grow(gap, (int)(lkey + lval + 2)) != OK)
+ if (ga_grow(gap, (int)(lkey + lval + 2)) == FAIL)
continue;
for (n = 0; n < lkey; n++)
*((WCHAR*)gap->ga_data + gap->ga_len++) = wkey[n];
// If memory allocation fails then we'll pop more than we push, eventually
// at the top level it will be OK again.
- if (ga_grow(&exestack, 1) != OK)
+ if (ga_grow(&exestack, 1) == FAIL)
return NULL;
entry = ((estack_T *)exestack.ga_data) + exestack.ga_len;
fromto_T *ftp;
char_u word[MAXWLEN];
- if (ga_grow(gap, 1) != OK)
+ if (ga_grow(gap, 1) == FAIL)
return;
ftp = ((fromto_T *)gap->ga_data) + gap->ga_len;
validate_current_state();
keepend_level = -1;
if (from->sst_stacksize
- && ga_grow(¤t_state, from->sst_stacksize) != FAIL)
+ && ga_grow(¤t_state, from->sst_stacksize) == OK)
{
if (from->sst_stacksize > SST_FIX_STATES)
bp = SYN_STATE_P(&(from->sst_union.sst_ga));
set_nextcmd(eap, rest);
if (!ends_excmd2(eap->cmd, rest) || eap->skip)
rest = NULL;
- else if (ga_grow(&curwin->w_s->b_syn_patterns, 1) != FAIL
+ else if (ga_grow(&curwin->w_s->b_syn_patterns, 1) == OK
&& (syn_id = syn_check_group(arg,
(int)(group_name_end - arg))) != 0)
{
set_nextcmd(eap, rest);
if (!ends_excmd(*rest) || eap->skip)
rest = NULL;
- else if (ga_grow(&(curwin->w_s->b_syn_patterns), pat_count) != FAIL
+ else if (ga_grow(&(curwin->w_s->b_syn_patterns), pat_count) == OK
&& (syn_id = syn_check_group(arg,
(int)(group_name_end - arg))) != 0)
{
if (HASHITEM_EMPTY(hi))
{
if (hash_add_item(&st->ht_match[mtt], hi, mfp, *hash) == FAIL
- || ga_grow(&st->ga_match[mtt], 1) != OK)
+ || ga_grow(&st->ga_match[mtt], 1) == FAIL)
{
// Out of memory! Just forget about the rest.
st->stop_searching = TRUE;
// Extend the array unless we're replacing an existing command
if (cmp != 0)
{
- if (ga_grow(gap, 1) != OK)
+ if (ga_grow(gap, 1) == FAIL)
goto fail;
if ((p = vim_strnsave(name, name_len)) == NULL)
goto fail;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1251,
/**/
1250,
/**/