]> Pileus Git - ~andy/git/commitdiff
for-each-ref: fix off by one read.
authorChristian Couder <chriscool@tuxfamily.org>
Mon, 12 Nov 2007 04:37:25 +0000 (05:37 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Nov 2007 07:40:33 +0000 (23:40 -0800)
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-for-each-ref.c

index 29f70aabc3f1df027f59dfdbac82e025653a8d87..0327f403060f80648aeed5a00f5aa1f06f403325 100644 (file)
@@ -297,7 +297,7 @@ static const char *find_wholine(const char *who, int wholen, const char *buf, un
                if (!eol)
                        return "";
                eol++;
-               if (eol[1] == '\n')
+               if (*eol == '\n')
                        return ""; /* end of header */
                buf = eol;
        }