summaryrefslogtreecommitdiff
path: root/builtin-for-each-ref.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-10-02 14:31:37 -0700
committerJunio C Hamano <gitster@pobox.com>2007-10-02 14:31:37 -0700
commit070f6918d148f6bac8f5cc829c53fd28be018697 (patch)
tree1397f82f6750e7ab9c3d11e636397d8cde59b993 /builtin-for-each-ref.c
parentd392e712a844e6ce029aa901902e08a3da82f89d (diff)
downloadgit-070f6918d148f6bac8f5cc829c53fd28be018697.tar.gz
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>
Diffstat (limited to 'builtin-for-each-ref.c')
-rw-r--r--builtin-for-each-ref.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
index c904ac3101..00afe89317 100644
--- a/builtin-for-each-ref.c
+++ b/builtin-for-each-ref.c
@@ -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;