]> git.ipfire.org Git - thirdparty/git.git/commitdiff
dateformat: parse %(xxdate) %(yydate:format) correctly
authorJunio C Hamano <gitster@pobox.com>
Tue, 2 Oct 2007 21:31:37 +0000 (14:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Oct 2007 21:31:37 +0000 (14:31 -0700)
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>
builtin-for-each-ref.c

index c904ac31018cc3b085367764e95dd0e17657a212..00afe8931768b96ec3f8baf72ab9221a4c2426b6 100644 (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;