get_remote_group(): handle remotes with single-character names
authorMichael Haggerty <mhagger@alum.mit.edu>
Tue, 28 Jul 2015 21:08:18 +0000 (23:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Jul 2015 21:39:10 +0000 (14:39 -0700)
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>
builtin/fetch.c
index 75a55e590bdc3411e5e4aeee6275fbfff4451904..9f7fe983a90e5df4becf35be76b66655a4c951a9 100644 (file)
@@ -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");
                }