Skip to content

Commit da55ff3

Browse files
peffgitster
authored andcommitted
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 41dd00b (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>
1 parent 5205749 commit da55ff3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pretty.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,7 @@ static int is_rfc2047_special(char ch, enum rfc2047_type type)
343343
return !(isalnum(ch) || ch == '!' || ch == '*' || ch == '+' || ch == '-' || ch == '/');
344344
}
345345

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)
348347
{
349348
int i;
350349

@@ -470,7 +469,7 @@ void pp_user_info(struct pretty_print_context *pp,
470469
}
471470

472471
strbuf_addstr(sb, "From: ");
473-
if (needs_rfc2047_encoding(namebuf, namelen, RFC2047_ADDRESS)) {
472+
if (needs_rfc2047_encoding(namebuf, namelen)) {
474473
add_rfc2047(sb, namebuf, namelen,
475474
encoding, RFC2047_ADDRESS);
476475
max_length = 76; /* per rfc2047 */
@@ -1728,7 +1727,7 @@ void pp_title_line(struct pretty_print_context *pp,
17281727
if (pp->print_email_subject) {
17291728
if (pp->rev)
17301729
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))
17321731
add_rfc2047(sb, title.buf, title.len,
17331732
encoding, RFC2047_SUBJECT);
17341733
else

0 commit comments

Comments
 (0)