Re: testsuite failures in mainline...
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 14, 2007, 23:18 UTC
- Message-ID
- <7v7ijgq311.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20071214.142448.52660507.davem@davemloft.net>
David Miller <davem@davemloft.net> writes:
Show 6 quoted lines
> if (!prefixcmp(key, "branch.")) {
> name = key + 7;
> subkey = strrchr(name, '.');
> branch = make_branch(name, subkey - name);
>
> What if 'subkey' is NULL? I bet that's what happening here.Wow, good eyes.
It makes me wonder what my C library has been returning during the tests...
---
remote.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/remote.c b/remote.c index 3fb0f99..0e00680 100644 --- a/remote.c +++ b/remote.c @@ -220,11 +220,11 @@ static int handle_config(const char *key, const char *value) if (!prefixcmp(key, "branch.")) { name = key + 7; subkey = strrchr(name, '.'); - branch = make_branch(name, subkey - name); if (!subkey) return 0; if (!value) return 0; + branch = make_branch(name, subkey - name); if (!strcmp(subkey, ".remote")) { branch->remote_name = xstrdup(value); if (branch == current_branch)