From a74fa1106dd29390077025e7f176cf6b53eada62 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Mon, 12 Nov 2007 05:37:25 +0100 Subject: [PATCH] for-each-ref: fix off by one read. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- builtin-for-each-ref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c index 29f70aabc..0327f4030 100644 --- a/builtin-for-each-ref.c +++ b/builtin-for-each-ref.c @@ -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; } -- 2.30.2