Commit 6776fd514bbfe46f59cd292fa806b42127ec2b0e

Carlos Martín Nieto 2011-04-06T15:17:06

config: really compare the variable name case-insensitively Make cvar_name_match really compare the last part of the variable ignoring the case. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/config.c b/src/config.c
index bd0886e..6dd2426 100644
--- a/src/config.c
+++ b/src/config.c
@@ -109,10 +109,7 @@ static int cvar_name_match(const char *local, const char *input)
 	/*
 	 * Anything after the last (possibly only) dot is case-insensitive
 	 */
-	if (!strcmp(input_dot, local_dot))
-		return 1;
-
-	return 0;
+	return !strcasecmp(input_dot, local_dot);
 }
 
 static git_cvar *cvar_list_find(git_cvar *start, const char *name)