diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-05-20 18:59:09 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-05-20 18:59:09 -0700 |
commit | 065b0702f748b50e69d67609ace2632ce04b79a1 (patch) | |
tree | 6a78474d618eb083713429dc064c1c8e07e6382c /builtin-for-each-ref.c | |
parent | d00e364de99d51bb76e437820e23cfa820417ec5 (diff) | |
parent | e701fadb9e0e51a6811690d95a53bd1f5b6fad86 (diff) | |
download | git-065b0702f748b50e69d67609ace2632ce04b79a1.tar.gz |
Merge branch 'maint'
* maint:
grep: fix word-regexp colouring
completion: use git rev-parse to detect bare repos
Cope better with a _lot_ of packs
for-each-ref: fix segfault in copy_email
Diffstat (limited to 'builtin-for-each-ref.c')
-rw-r--r-- | builtin-for-each-ref.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c index 91e8f95fd2..d091e04af9 100644 --- a/builtin-for-each-ref.c +++ b/builtin-for-each-ref.c @@ -339,8 +339,11 @@ static const char *copy_name(const char *buf) static const char *copy_email(const char *buf) { const char *email = strchr(buf, '<'); - const char *eoemail = strchr(email, '>'); - if (!email || !eoemail) + const char *eoemail; + if (!email) + return ""; + eoemail = strchr(email, '>'); + if (!eoemail) return ""; return xmemdupz(email, eoemail + 1 - email); } |