From: Jeff King Date: Wed, 20 Mar 2019 08:16:36 +0000 (-0400) Subject: pretty: drop unused "type" parameter in needs_rfc2047_encoding() X-Git-Tag: v2.22.0-rc0~72^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/da55ff3d84b9edc635aba4a986de25ec219acd7a?ds=inline;hp=--cc 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 Signed-off-by: Junio C Hamano --- da55ff3d84b9edc635aba4a986de25ec219acd7a diff --git a/pretty.c b/pretty.c index f496f0f128..f925a014f9 100644 --- a/pretty.c +++ b/pretty.c @@ -343,8 +343,7 @@ static int is_rfc2047_special(char ch, enum rfc2047_type type) return !(isalnum(ch) || ch == '!' || ch == '*' || ch == '+' || ch == '-' || ch == '/'); } -static int needs_rfc2047_encoding(const char *line, int len, - enum rfc2047_type type) +static int needs_rfc2047_encoding(const char *line, int len) { int i; @@ -470,7 +469,7 @@ void pp_user_info(struct pretty_print_context *pp, } strbuf_addstr(sb, "From: "); - if (needs_rfc2047_encoding(namebuf, namelen, RFC2047_ADDRESS)) { + if (needs_rfc2047_encoding(namebuf, namelen)) { add_rfc2047(sb, namebuf, namelen, encoding, RFC2047_ADDRESS); max_length = 76; /* per rfc2047 */ @@ -1728,7 +1727,7 @@ void pp_title_line(struct pretty_print_context *pp, if (pp->print_email_subject) { if (pp->rev) fmt_output_email_subject(sb, pp->rev); - if (needs_rfc2047_encoding(title.buf, title.len, RFC2047_SUBJECT)) + if (needs_rfc2047_encoding(title.buf, title.len)) add_rfc2047(sb, title.buf, title.len, encoding, RFC2047_SUBJECT); else