dateformat: parse %(xxdate) %(yydate:format) correctly
[gitweb.git] / 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;