{
struct grep_data *g = data;
int ret;
- char *buf;
+ char buf[BUFSIZ];
if (!g->header && *f->name) {
return FALSE;
return FALSE;
}
- ret = regexec(g->preg, f->value, 0, NULL, 0) == REG_NOMATCH;
+ if(decode_rfc2047(f->value, buf, sizeof(buf))) {
+ ret = regexec(g->preg, buf, 0, NULL, 0);
+ } else {
+ ret = regexec(g->preg, f->value, 0, NULL, 0);
+ }
switch (ret) {
case 0:
return TRUE;
case REG_NOMATCH:
return FALSE;
default:
- buf = mh_xcalloc(BUFSIZ, sizeof(char));
- regerror(ret, g->preg, buf, BUFSIZ*sizeof(char));
+ regerror(ret, g->preg, buf, sizeof(buf));
fprintf(stderr, "%s\n", buf);
return FALSE;
}