Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: testsuite failures in mainline...

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:59
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

David Miller [off-list ref] writes:
	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)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help