From: Junio C Hamano Date: Tue, 2 Oct 2007 21:31:37 +0000 (-0700) Subject: dateformat: parse %(xxdate) %(yydate:format) correctly X-Git-Tag: v1.5.4-rc0~392^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=070f6918d148f6bac8f5cc829c53fd28be018697;p=git.git 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 --- 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;