@matheusbsbs / matheus-bagliano / commits / 070f6918d1
Fork 0

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 <gitster@pobox.com>

Junio C Hamano committed Oct 2, 2007 at 14:31 UTC 070f6918d148f6bac8f5cc829c53fd28be018697
1 file changed +1 -1
builtin-for-each-ref.c
+1 -1
@@ -113,7 +113,7 @@ static int parse_atom(const char *atom, const char *ep)
113 * table.
114 */
115 const char *formatp = strchr(sp, ':');
116 - if (!formatp)
116 + if (!formatp || ep < formatp)
117 formatp = ep;
118 if (len == formatp - sp && !memcmp(valid_atom[i].name, sp, len))
119 break;