Commit c16ebaa6bd68d656e13c627f07920466846d5ab6

Carlos Martín Nieto 2018-05-24T19:05:59

submodule: replace index with strchr which exists on Windows

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/submodule.c b/src/submodule.c
index 7565743..4f7a6c6 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -374,7 +374,7 @@ int git_submodule_name_is_valid(git_repository *repo, const char *name, int flag
 		flags = GIT_PATH_REJECT_FILESYSTEM_DEFAULTS;
 
 	/* Avoid allocating a new string if we can avoid it */
-	if (index(name, '\\')) {
+	if (strchr(name, '\\') != NULL) {
 		if ((error = git_path_normalize_slashes(&buf, name)) < 0)
 			return error;
 	} else {