diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-11-14 14:03:50 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-11-14 14:03:50 -0800 |
commit | 37ec2b4c26901d5f1ca19948189dc2b6f21523d5 (patch) | |
tree | 42fb61c490d77c882699f9685ab466d21a51e1d7 /builtin-fetch--tool.c | |
parent | Merge branch 'rr/cvsexportcommit-w' (diff) | |
parent | Fix preprocessor logic that determines the availablity of strchrnul(). (diff) | |
download | tgif-37ec2b4c26901d5f1ca19948189dc2b6f21523d5.tar.xz |
Merge branch 'rs/pretty'
* rs/pretty:
Fix preprocessor logic that determines the availablity of strchrnul().
Simplify strchrnul() compat code
--format=pretty: avoid calculating expensive expansions twice
add strbuf_adddup()
--pretty=format: parse commit message only once
--pretty=format: on-demand format expansion
Add strchrnul()
Diffstat (limited to 'builtin-fetch--tool.c')
-rw-r--r-- | builtin-fetch--tool.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c index 6a78517958..ed60847d9f 100644 --- a/builtin-fetch--tool.c +++ b/builtin-fetch--tool.c @@ -435,9 +435,7 @@ static int pick_rref(int sha1_only, const char *rref, const char *ls_remote_resu cp++; if (!*cp) break; - np = strchr(cp, '\n'); - if (!np) - np = cp + strlen(cp); + np = strchrnul(cp, '\n'); if (pass) { lrr_list[i].line = cp; lrr_list[i].name = cp + 41; @@ -461,9 +459,7 @@ static int pick_rref(int sha1_only, const char *rref, const char *ls_remote_resu rref++; if (!*rref) break; - next = strchr(rref, '\n'); - if (!next) - next = rref + strlen(rref); + next = strchrnul(rref, '\n'); rreflen = next - rref; for (i = 0; i < lrr_count; i++) { |