summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 40d88d4)
raw | patch | inline | side by side (parent: 40d88d4)
author | Dennis Stosberg <dennis@stosberg.net> | |
Tue, 11 Apr 2006 16:37:58 +0000 (18:37 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 11 Apr 2006 18:45:37 +0000 (11:45 -0700) |
strchr() is more portable than index() and is used everywhere in
git already.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git already.
Signed-off-by: Junio C Hamano <junkio@cox.net>
http-fetch.c | patch | blob | history | |
http-push.c | patch | blob | history |
diff --git a/http-fetch.c b/http-fetch.c
index 71a7dafd696d0da3a9662fb19cd83f87df1ec9b4..861644b27ee0c01a780b68daa43c259dd978a538 100644 (file)
--- a/http-fetch.c
+++ b/http-fetch.c
newalt->packs = NULL;
path = strstr(target, "//");
if (path) {
- path = index(path+2, '/');
+ path = strchr(path+2, '/');
if (path)
newalt->path_len = strlen(path);
}
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)
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);
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 57cefdea530171c71c72229a85aa0212dedb2c5a..994ee90035c4ae5e055df79cea8621d294190a3f 100644 (file)
--- a/http-push.c
+++ b/http-push.c
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)
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);
char *path = strstr(arg, "//");
remote->url = arg;
if (path) {
- path = index(path+2, '/');
+ path = strchr(path+2, '/');
if (path)
remote->path_len = strlen(path);
}