patch 9.0.1251: checking returned value of ga_grow() is inconsistent
Problem: Checking returned value of ga_grow() is inconsistent.
Solution: Check for FAIL instaed of "not OK". (Yegappan Lakshmanan,
closes #11897)
diff --git a/src/syntax.c b/src/syntax.c
index 614f52e..719bc9c 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1438,7 +1438,7 @@
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));
@@ -4946,7 +4946,7 @@
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)
{
@@ -5186,7 +5186,7 @@
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)
{