summaryrefslogtreecommitdiff
path: root/builtin-for-each-ref.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2007-10-02 14:31:37 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-10-02 14:31:37 -0700
commit070f6918d148f6bac8f5cc829c53fd28be018697 (patch)
tree1397f82f6750e7ab9c3d11e636397d8cde59b993 /builtin-for-each-ref.c
parentMake for-each-ref's grab_date() support per-atom formatting (diff)
downloadtgif-070f6918d148f6bac8f5cc829c53fd28be018697.tar.xz
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;