struct Pattern *pat = NULL;
char buf[LONG_STRING] = "", *simple = NULL;
struct Buffer err;
+ int rc = -1;
struct Progress progress;
mutt_str_strfcpy(buf, NONULL(Context->pattern), sizeof(buf));
pat = mutt_pattern_comp(buf, MUTT_FULL_MSG, &err);
if (!pat)
{
- FREE(&simple);
mutt_error("%s", err.data);
- FREE(&err.data);
- return -1;
+ goto bail;
}
#ifdef USE_IMAP
if (Context->magic == MUTT_IMAP && imap_search(Context, pat) < 0)
- return -1;
+ goto bail;
#endif
mutt_progress_init(&progress, _("Executing command on matching messages..."),
Context->limit_pattern = mutt_pattern_comp(buf, MUTT_FULL_MSG, &err);
}
}
+
+ rc = 0;
+
+bail:
FREE(&simple);
mutt_pattern_free(&pat);
FREE(&err.data);
- return 0;
+ return rc;
}
int mutt_search_command(int cur, int op)
LastSearch[0] = '\0';
return -1;
}
+ FREE(&err.data);
mutt_clear_error();
}
}