aboutsummaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-07-28 23:08:18 +0200
committerJunio C Hamano <gitster@pobox.com>2015-07-28 14:39:10 -0700
commitc26f7d7b268c14f9ee7fa9cbeaad3bc890526d49 (patch)
tree2f18999443f5db110f860fe65bf23123f0aa96ee /builtin/fetch.c
parent9a3d637541a5b6fcd84b6f5fa057e597d1696460 (diff)
downloadgit-c26f7d7b268c14f9ee7fa9cbeaad3bc890526d49.tar.gz
git-c26f7d7b268c14f9ee7fa9cbeaad3bc890526d49.tar.xz
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>
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c3
1 files changed, 1 insertions, 2 deletions
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");
}