OSDN Git Service

remote.c: read $GIT_DIR/remotes/* with strbuf_getline()
authorJunio C Hamano <gitster@pobox.com>
Wed, 28 Oct 2015 20:27:33 +0000 (13:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 15 Jan 2016 18:34:42 +0000 (10:34 -0800)
These files can be edited with a DOS editor, leaving CR at the end
of the line if read with strbuf_getline().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c

index f195693..7d61dab 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -256,7 +256,7 @@ static void read_remotes_file(struct remote *remote)
        if (!f)
                return;
        remote->origin = REMOTE_REMOTES;
-       while (strbuf_getline_lf(&buf, f) != EOF) {
+       while (strbuf_getline(&buf, f) != EOF) {
                const char *v;
 
                strbuf_rtrim(&buf);