From c26f7d7b268c14f9ee7fa9cbeaad3bc890526d49 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Tue, 28 Jul 2015 23:08:18 +0200 Subject: get_remote_group(): handle remotes with single-character names The code for splitting a whitespace-separated list of values in "remotes." had an off-by-one error that caused it to skip over remotes whose names consist of a single character. Also remove unnecessary braces. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- builtin/fetch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'builtin/fetch.c') diff --git a/builtin/fetch.c b/builtin/fetch.c index 75a55e590..9f7fe983a 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -978,10 +978,9 @@ static int get_remote_group(const char *key, const char *value, void *priv) /* split list by white space */ int space = strcspn(value, " \t\n"); while (*value) { - if (space > 1) { + if (space >= 1) string_list_append(g->list, xstrndup(value, space)); - } value += space + (value[space] != '\0'); space = strcspn(value, " \t\n"); } -- cgit v1.2.1