From 070f6918d148f6bac8f5cc829c53fd28be018697 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 2 Oct 2007 14:31:37 -0700 Subject: [PATCH] dateformat: parse %(xxdate) %(yydate:format) correctly Andy Parkins noticed that parsing of the above would not correctly notice that xxdate does not have any format specifier. 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 c904ac310..00afe8931 100644 --- a/builtin-for-each-ref.c +++ b/builtin-for-each-ref.c @@ -113,7 +113,7 @@ static int parse_atom(const char *atom, const char *ep) * table. */ const char *formatp = strchr(sp, ':'); - if (!formatp) + if (!formatp || ep < formatp) formatp = ep; if (len == formatp - sp && !memcmp(valid_atom[i].name, sp, len)) break; -- 2.30.2