summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-03-20 08:16:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-20 09:34:09 (GMT)
commitda55ff3d84b9edc635aba4a986de25ec219acd7a (patch)
tree73e4051c009de5d270c20e0e27afcb72ebfe5738 /pretty.c
parent5205749d2ca81ea1d124ba7d799f4b319084ca68 (diff)
downloadgit-da55ff3d84b9edc635aba4a986de25ec219acd7a.zip
git-da55ff3d84b9edc635aba4a986de25ec219acd7a.tar.gz
git-da55ff3d84b9edc635aba4a986de25ec219acd7a.tar.bz2
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>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/pretty.c b/pretty.c
index f496f0f..f925a01 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