From: Dennis Stosberg Date: Tue, 11 Apr 2006 16:37:58 +0000 (+0200) Subject: Replace index() with strchr(). X-Git-Tag: v1.3.0-rc4~19^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ef9e58c826a4fcaa13457cd8177518163f82972a;p=git.git Replace index() with strchr(). strchr() is more portable than index() and is used everywhere in git already. Signed-off-by: Junio C Hamano --- diff --git a/http-fetch.c b/http-fetch.c index 71a7dafd6..861644b27 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -597,7 +597,7 @@ static void process_alternates_response(void *callback_data) newalt->packs = NULL; path = strstr(target, "//"); if (path) { - path = index(path+2, '/'); + path = strchr(path+2, '/'); if (path) newalt->path_len = strlen(path); } @@ -678,7 +678,7 @@ static void xml_start_tag(void *userData, const char *name, const char **atts) { struct xml_ctx *ctx = (struct xml_ctx *)userData; - const char *c = index(name, ':'); + const char *c = strchr(name, ':'); int new_len; if (c == NULL) @@ -707,7 +707,7 @@ static void xml_end_tag(void *userData, const char *name) { struct xml_ctx *ctx = (struct xml_ctx *)userData; - const char *c = index(name, ':'); + const char *c = strchr(name, ':'); char *ep; ctx->userFunc(ctx, 1); @@ -1261,7 +1261,7 @@ int main(int argc, char **argv) alt->next = NULL; path = strstr(url, "//"); if (path) { - path = index(path+2, '/'); + path = strchr(path+2, '/'); if (path) alt->path_len = strlen(path); } diff --git a/http-push.c b/http-push.c index 57cefdea5..994ee9003 100644 --- a/http-push.c +++ b/http-push.c @@ -1211,7 +1211,7 @@ static void xml_start_tag(void *userData, const char *name, const char **atts) { struct xml_ctx *ctx = (struct xml_ctx *)userData; - const char *c = index(name, ':'); + const char *c = strchr(name, ':'); int new_len; if (c == NULL) @@ -1240,7 +1240,7 @@ static void xml_end_tag(void *userData, const char *name) { struct xml_ctx *ctx = (struct xml_ctx *)userData; - const char *c = index(name, ':'); + const char *c = strchr(name, ':'); char *ep; ctx->userFunc(ctx, 1); @@ -2350,7 +2350,7 @@ int main(int argc, char **argv) char *path = strstr(arg, "//"); remote->url = arg; if (path) { - path = index(path+2, '/'); + path = strchr(path+2, '/'); if (path) remote->path_len = strlen(path); }