ident.c: read /etc/mailname with strbuf_getline()

Just in case /etc/mailname file was edited with a DOS editor, read it with strbuf_getline() so that a stray CR is not included as the last character of the mail hostname. We _might_ want to more aggressively discard whitespace characters around the line with strbuf_trim(), but that is a bit outside the scope of this series. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Oct 28, 2015 at 13:24 UTC 1f3b1efd18a935fed41431132c67cde5a94833ae
1 file changed +1 -1
ident.c
+1 -1
@@ -76,7 +76,7 @@ static int add_mailname_host(struct strbuf *buf)
76 strerror(errno));
77 return -1;
78 }
79 - if (strbuf_getline_lf(&mailnamebuf, mailname) == EOF) {
79 + if (strbuf_getline(&mailnamebuf, mailname) == EOF) {
80 if (ferror(mailname))
81 warning("cannot read /etc/mailname: %s",
82 strerror(errno));