From f8c5d136f1e7dcfaad6698f63d82cc69123ccf5f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 21 Feb 2017 14:26:10 -0800 Subject: [PATCH] config: squelch stupid compiler 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 --- config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.c b/config.c index e7f7ff19382754..90de27853f7867 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;