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.
Showing
4 changed files
with
25 additions
and
5 deletions
... | @@ -114,6 +114,17 @@ mu_parse_lc_all (const char *arg, struct mu_lc_all *str, int flags) | ... | @@ -114,6 +114,17 @@ mu_parse_lc_all (const char *arg, struct mu_lc_all *str, int flags) |
114 | int rc; | 114 | int rc; |
115 | 115 | ||
116 | memset (str, 0, sizeof (str[0])); | 116 | memset (str, 0, sizeof (str[0])); |
117 | if (!arg) | ||
118 | { | ||
119 | if (flags & MU_LC_LANG) | ||
120 | { | ||
121 | str->language = strdup ("C"); | ||
122 | if (!str->language) | ||
123 | return ENOMEM; | ||
124 | } | ||
125 | return 0; | ||
126 | } | ||
127 | |||
117 | rc = _parse_lc_all (arg, str, flags); | 128 | rc = _parse_lc_all (arg, str, flags); |
118 | if (rc == 0 && !str->charset) | 129 | if (rc == 0 && !str->charset) |
119 | { | 130 | { | ... | ... |
... | @@ -95,6 +95,8 @@ MAINTAINERCLEANFILES=$(BUILT_SOURCES) | ... | @@ -95,6 +95,8 @@ MAINTAINERCLEANFILES=$(BUILT_SOURCES) |
95 | 95 | ||
96 | EXTRA_DIST = mh_fmtgram.y pick.y mh_alias.y mh_alias.l | 96 | EXTRA_DIST = mh_fmtgram.y pick.y mh_alias.y mh_alias.l |
97 | 97 | ||
98 | mhlibdir = $(pkgdatadir)/mh | ||
99 | |||
98 | INCLUDES = @MU_APP_COMMON_INCLUDES@ | 100 | INCLUDES = @MU_APP_COMMON_INCLUDES@ |
99 | AM_CPPFLAGS = -D_GNU_SOURCE -DMHLIBDIR=\"$(mhlibdir)\" -DMHBINDIR=\"$(bindir)\" | 101 | AM_CPPFLAGS = -D_GNU_SOURCE -DMHLIBDIR=\"$(mhlibdir)\" -DMHBINDIR=\"$(bindir)\" |
100 | mh_LIBS = \ | 102 | mh_LIBS = \ | ... | ... |
... | @@ -296,18 +296,24 @@ struct eval_env | ... | @@ -296,18 +296,24 @@ struct eval_env |
296 | static int | 296 | static int |
297 | match_header (mu_message_t msg, char *comp, regex_t *regex) | 297 | match_header (mu_message_t msg, char *comp, regex_t *regex) |
298 | { | 298 | { |
299 | int rc; | ||
299 | size_t i, count; | 300 | size_t i, count; |
300 | mu_header_t hdr = NULL; | 301 | mu_header_t hdr = NULL; |
301 | char buf[128]; | 302 | const char *buf; |
302 | 303 | ||
303 | mu_message_get_header (msg, &hdr); | 304 | rc = mu_message_get_header (msg, &hdr); |
305 | if (rc) | ||
306 | { | ||
307 | mu_error (_("cannot get header: %s"), mu_strerror (rc)); | ||
308 | return 0; | ||
309 | } | ||
304 | mu_header_get_field_count (hdr, &count); | 310 | mu_header_get_field_count (hdr, &count); |
305 | for (i = 1; i <= count; i++) | 311 | for (i = 1; i <= count; i++) |
306 | { | 312 | { |
307 | mu_header_get_field_name (hdr, i, buf, sizeof buf, NULL); | 313 | mu_header_sget_field_name (hdr, i, &buf); |
308 | if (mu_c_strcasecmp (buf, comp) == 0) | 314 | if (mu_c_strcasecmp (buf, comp) == 0) |
309 | { | 315 | { |
310 | mu_header_get_field_value (hdr, i, buf, sizeof buf, NULL); | 316 | mu_header_sget_field_value (hdr, i, &buf); |
311 | if (regexec (regex, buf, 0, NULL, 0) == 0) | 317 | if (regexec (regex, buf, 0, NULL, 0) == 0) |
312 | return 1; | 318 | return 1; |
313 | } | 319 | } | ... | ... |
... | @@ -221,8 +221,9 @@ opt_handler (int key, char *arg, struct argp_state *state) | ... | @@ -221,8 +221,9 @@ opt_handler (int key, char *arg, struct argp_state *state) |
221 | break; | 221 | break; |
222 | 222 | ||
223 | case ARG_QUERY: | 223 | case ARG_QUERY: |
224 | mh_opt_notimpl_warning ("-inplace"); | ||
225 | query_mode = is_true (arg); | 224 | query_mode = is_true (arg); |
225 | if (query_mode) | ||
226 | mh_opt_notimpl_warning ("-query"); | ||
226 | break; | 227 | break; |
227 | 228 | ||
228 | case ARG_FILTER: | 229 | case ARG_FILTER: | ... | ... |
-
Please register or sign in to post a comment