at = strchr(f.buf, '@');
if (!at) {
parse_bogus_from(mi, from);
- return;
+ goto out;
}
/*
* If we already have one email, don't take any confusing lines
*/
- if (mi->email.len && strchr(at + 1, '@')) {
- strbuf_release(&f);
- return;
- }
+ if (mi->email.len && strchr(at + 1, '@'))
+ goto out;
/* Pick up the string around '@', possibly delimited with <>
* pair; that is the email part.
}
get_sane_name(&mi->name, &f, &mi->email);
+out:
strbuf_release(&f);
}
while ((c = *in++) != 0) {
if (c == '=') {
- int d = *in++;
+ int ch, d = *in;
if (d == '\n' || !d)
break; /* drop trailing newline */
- strbuf_addch(out, (hexval(d) << 4) | hexval(*in++));
- continue;
+ ch = hex2chr(in);
+ if (ch >= 0) {
+ strbuf_addch(out, ch);
+ in += 2;
+ continue;
+ }
+ /* garbage -- fall through */
}
if (rfc2047 && c == '_') /* rfc2047 4.2 (2) */
c = 0x20;
if (!handle_commit_msg(mi, line))
break;
mi->filter_stage++;
+ /* fallthrough */
case 1:
handle_patch(mi, line);
break;
error("Detected mismatched boundaries, can't recover");
mi->input_error = -1;
mi->content_top = mi->content;
+ strbuf_release(&newline);
return 0;
}
handle_filter(mi, &newline);