From: Junio C Hamano Date: Tue, 18 Mar 2014 20:51:18 +0000 (-0700) Subject: Merge branch 'rm/strchrnul-not-strlen' X-Git-Tag: v2.0.0-rc0~86 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6f75e48323bc3071495025fd14105e9dffa9e8dd Merge branch 'rm/strchrnul-not-strlen' * rm/strchrnul-not-strlen: use strchrnul() in place of strchr() and strlen() --- 6f75e48323bc3071495025fd14105e9dffa9e8dd diff --cc archive.c index 7d0976fe55,d1962157c8..3fc0fb2928 --- a/archive.c +++ b/archive.c @@@ -258,10 -257,10 +258,10 @@@ static void parse_treeish_arg(const cha unsigned char sha1[20]; /* Remotes are only allowed to fetch actual refs */ - if (remote) { + if (remote && !remote_allow_unreachable) { char *ref = NULL; - const char *colon = strchr(name, ':'); - int refnamelen = colon ? colon - name : strlen(name); + const char *colon = strchrnul(name, ':'); + int refnamelen = colon - name; if (!dwim_ref(name, refnamelen, sha1, &ref)) die("no such ref: %.*s", refnamelen, name);