summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-02-21 14:26:10 -0800
committerJunio C Hamano <gitster@pobox.com>2017-02-21 14:26:10 -0800
commitf8c5d136f1e7dcfaad6698f63d82cc69123ccf5f (patch)
treec6cd2b9524b3067937bce99fcc9c569b8351856a
parent39b1230cc5b132f9d807ab0ed682fb16664bc04c (diff)
downloadgit-jc/config-case-cmdline.tar.gz
config: squelch stupid compilerjc/config-case-cmdline
Some compilers do not realize that *cp is always '.' when the loop to find the last dot begins, and instead gives a useless warning that says last_dot may be uninitialized. Squelch it by being a bit more explicit if stupid. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/config.c b/config.c
index e7f7ff1938..90de27853f 100644
--- a/config.c
+++ b/config.c
@@ -239,7 +239,7 @@ static int canonicalize_config_variable_name(char *varname)
return -1; /* no section? */
/* find the last dot (we start from the first dot we just found) */
- for (; *cp; cp++)
+ for (last_dot = cp; *cp; cp++)
if (*cp == '.')
last_dot = cp;