Commit 807f3d24 807f3d246e0dbe13da92328dc5dc47ca9f6d504a by Sergey Poznyakoff

Bugfixes

* libmailutils/base/lcall.c (mu_parse_lc_all): Allow for arg==NULL.
* mh/Makefile.am: Define mhlibdir.
* mh/pick.y (match_header): Use sget accessors.
* mh/repl.c: Accept -noquery silently.
1 parent d3269a42
......@@ -114,6 +114,17 @@ mu_parse_lc_all (const char *arg, struct mu_lc_all *str, int flags)
int rc;
memset (str, 0, sizeof (str[0]));
if (!arg)
{
if (flags & MU_LC_LANG)
{
str->language = strdup ("C");
if (!str->language)
return ENOMEM;
}
return 0;
}
rc = _parse_lc_all (arg, str, flags);
if (rc == 0 && !str->charset)
{
......
......@@ -95,6 +95,8 @@ MAINTAINERCLEANFILES=$(BUILT_SOURCES)
EXTRA_DIST = mh_fmtgram.y pick.y mh_alias.y mh_alias.l
mhlibdir = $(pkgdatadir)/mh
INCLUDES = @MU_APP_COMMON_INCLUDES@
AM_CPPFLAGS = -D_GNU_SOURCE -DMHLIBDIR=\"$(mhlibdir)\" -DMHBINDIR=\"$(bindir)\"
mh_LIBS = \
......
......@@ -296,18 +296,24 @@ struct eval_env
static int
match_header (mu_message_t msg, char *comp, regex_t *regex)
{
int rc;
size_t i, count;
mu_header_t hdr = NULL;
char buf[128];
const char *buf;
mu_message_get_header (msg, &hdr);
rc = mu_message_get_header (msg, &hdr);
if (rc)
{
mu_error (_("cannot get header: %s"), mu_strerror (rc));
return 0;
}
mu_header_get_field_count (hdr, &count);
for (i = 1; i <= count; i++)
{
mu_header_get_field_name (hdr, i, buf, sizeof buf, NULL);
mu_header_sget_field_name (hdr, i, &buf);
if (mu_c_strcasecmp (buf, comp) == 0)
{
mu_header_get_field_value (hdr, i, buf, sizeof buf, NULL);
mu_header_sget_field_value (hdr, i, &buf);
if (regexec (regex, buf, 0, NULL, 0) == 0)
return 1;
}
......
......@@ -221,8 +221,9 @@ opt_handler (int key, char *arg, struct argp_state *state)
break;
case ARG_QUERY:
mh_opt_notimpl_warning ("-inplace");
query_mode = is_true (arg);
if (query_mode)
mh_opt_notimpl_warning ("-query");
break;
case ARG_FILTER:
......