Skip to content

Commit

Permalink
Fix checking the return of the eat_* APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
gahr authored and flatcap committed Sep 11, 2020
1 parent a988e83 commit e25b8db
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pattern/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,6 @@ struct PatternList *mutt_pattern_comp(const char *s, PatternCompFlags flags, str

if (entry->eat_arg)
{
int rc_eat = 0;
if (ps.dptr[0] == '\0')
{
mutt_buffer_printf(err, "%s", _("missing parameter"));
Expand All @@ -1246,27 +1245,28 @@ struct PatternList *mutt_pattern_comp(const char *s, PatternCompFlags flags, str
switch (entry->eat_arg)
{
case EAT_REGEX:
rc_eat = eat_regex(pat, flags, &ps, err);
if (!eat_regex(pat, flags, &ps, err))
goto cleanup;
break;
case EAT_DATE:
rc_eat = eat_date(pat, flags, &ps, err);
if (!eat_date(pat, flags, &ps, err))
goto cleanup;
break;
case EAT_RANGE:
rc_eat = eat_range(pat, flags, &ps, err);
if (!eat_range(pat, flags, &ps, err))
goto cleanup;
break;
case EAT_MESSAGE_RANGE:
rc_eat = eat_message_range(pat, flags, &ps, err);
if (!eat_message_range(pat, flags, &ps, err))
goto cleanup;
break;
case EAT_QUERY:
rc_eat = eat_query(pat, flags, &ps, err);
if (!eat_query(pat, flags, &ps, err))
goto cleanup;
break;
default:
break;
}
if (rc_eat == -1)
{
goto cleanup;
}
}
implicit = true;
break;
Expand Down

0 comments on commit e25b8db

Please sign in to comment.