Browse Source

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>
maint
Junio C Hamano 17 years ago
parent
commit
070f6918d1
  1. 2
      builtin-for-each-ref.c

2
builtin-for-each-ref.c

@ -113,7 +113,7 @@ static int parse_atom(const char *atom, const char *ep)
* table. * table.
*/ */
const char *formatp = strchr(sp, ':'); const char *formatp = strchr(sp, ':');
if (!formatp) if (!formatp || ep < formatp)
formatp = ep; formatp = ep;
if (len == formatp - sp && !memcmp(valid_atom[i].name, sp, len)) if (len == formatp - sp && !memcmp(valid_atom[i].name, sp, len))
break; break;

Loading…
Cancel
Save