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 <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Jul 28, 2015 at 23:08 UTC
c26f7d7b268c14f9ee7fa9cbeaad3bc890526d49
1 file changed
+1
-2
builtin/fetch.c
+1
-2
@@ -978,10 +978,9 @@ static int get_remote_group(const char *key, const char *value, void *priv)
978
/* split list by white space */
979
int space = strcspn(value, " \t\n");
980
while (*value) {
981
- if (space > 1) {
981
+ if (space >= 1)
982
string_list_append(g->list,
983
xstrndup(value, space));
984
- }
984
value += space + (value[space] != '\0');
985
space = strcspn(value, " \t\n");
986
}