Skip to content

Commit c26f7d7

Browse files
mhaggergitster
authored andcommitted
get_remote_group(): handle remotes with single-character names
The code for splitting a whitespace-separated list of values in "remotes.<name>" 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9a3d637 commit c26f7d7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

builtin/fetch.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,10 +978,9 @@ static int get_remote_group(const char *key, const char *value, void *priv)
978978
/* split list by white space */
979979
int space = strcspn(value, " \t\n");
980980
while (*value) {
981-
if (space > 1) {
981+
if (space >= 1)
982982
string_list_append(g->list,
983983
xstrndup(value, space));
984-
}
985984
value += space + (value[space] != '\0');
986985
space = strcspn(value, " \t\n");
987986
}

0 commit comments

Comments
 (0)