1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-18 18:59:38 +02:00

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>
This commit is contained in:
Junio C Hamano 2007-10-02 14:31:37 -07:00
parent d392e712a8
commit 070f6918d1

View File

@ -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;