pretty: drop unused "type" parameter in needs_rfc2047_encoding()
The "should we encode" check was split off from add_rfc2047() into its own function in 41dd00bad3 (format-patch: fix rfc2047 address encoding with respect to rfc822 specials, 2012-10-18). But only the "add" half needs to know the rfc2047_type, since it only affects _how_ we encode, not whether we do. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Mar 20, 2019 at 04:16 UTC
da55ff3d84b9edc635aba4a986de25ec219acd7a
1 file changed
+3
-4
pretty.c
+3
-4
@@ -343,8 +343,7 @@ static int is_rfc2047_special(char ch, enum rfc2047_type type)
343
return !(isalnum(ch) || ch == '!' || ch == '*' || ch == '+' || ch == '-' || ch == '/');
344
}
345
346
-static int needs_rfc2047_encoding(const char *line, int len,
347
- enum rfc2047_type type)
346
+static int needs_rfc2047_encoding(const char *line, int len)
347
{
348
int i;
349
@@ -470,7 +469,7 @@ void pp_user_info(struct pretty_print_context *pp,
469
}
470
471
strbuf_addstr(sb, "From: ");
473
- if (needs_rfc2047_encoding(namebuf, namelen, RFC2047_ADDRESS)) {
472
+ if (needs_rfc2047_encoding(namebuf, namelen)) {
473
add_rfc2047(sb, namebuf, namelen,
474
encoding, RFC2047_ADDRESS);
475
max_length = 76; /* per rfc2047 */
@@ -1728,7 +1727,7 @@ void pp_title_line(struct pretty_print_context *pp,
1727
if (pp->print_email_subject) {
1728
if (pp->rev)
1729
fmt_output_email_subject(sb, pp->rev);
1731
- if (needs_rfc2047_encoding(title.buf, title.len, RFC2047_SUBJECT))
1730
+ if (needs_rfc2047_encoding(title.buf, title.len))
1731
add_rfc2047(sb, title.buf, title.len,
1732
encoding, RFC2047_SUBJECT);
1733
else