Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-28 23:24:41 +0300
committerJunio C Hamano <gitster@pobox.com>2016-01-15 21:34:41 +0300
commit1f3b1efd18a935fed41431132c67cde5a94833ae (patch)
treec058d5bc621720997f357e4bedf9a0673ea18d0f /ident.c
parent72e37b6ac851c3926956c9d11a40260f08bf1c5e (diff)
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>
Diffstat (limited to 'ident.c')
-rw-r--r--ident.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ident.c b/ident.c
index 9dd3ae3452..3da5556342 100644
--- a/ident.c
+++ b/ident.c
@@ -76,7 +76,7 @@ static int add_mailname_host(struct strbuf *buf)
strerror(errno));
return -1;
}
- if (strbuf_getline_lf(&mailnamebuf, mailname) == EOF) {
+ if (strbuf_getline(&mailnamebuf, mailname) == EOF) {
if (ferror(mailname))
warning("cannot read /etc/mailname: %s",
strerror(errno));