http-fetch: remove path_len from struct alt_base, it was computed but never used
Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Gerrit Pape committed
Mar 28, 2007 at 09:47 UTC
9c880b3ea56a7ff2f66dcf12eb2351f0f51a54ef
1 file changed
+3
-17
http-fetch.c
+3
-17
@@ -17,7 +17,6 @@ static struct curl_slist *no_pragma_header;
17
struct alt_base
18
{
19
char *base;
20
- int path_len;
20
int got_indices;
21
struct packed_git *packs;
22
struct alt_base *next;
@@ -515,7 +514,6 @@ static void process_alternates_response(void *callback_data)
514
int serverlen = 0;
515
struct alt_base *newalt;
516
char *target = NULL;
518
- char *path;
517
if (data[i] == '/') {
518
/* This counts
519
* http://git.host/pub/scm/linux.git/
@@ -583,12 +581,6 @@ static void process_alternates_response(void *callback_data)
581
newalt->base = target;
582
newalt->got_indices = 0;
583
newalt->packs = NULL;
586
- path = strstr(target, "//");
587
- if (path) {
588
- path = strchr(path+2, '/');
589
- if (path)
590
- newalt->path_len = strlen(path);
591
- }
584
585
while (tail->next != NULL)
586
tail = tail->next;
@@ -999,7 +991,7 @@ int main(int argc, const char **argv)
991
const char **write_ref = NULL;
992
char **commit_id;
993
const char *url;
1002
- char *path;
994
+ char *s;
995
int arg = 1;
996
int rc = 0;
997
@@ -1046,17 +1038,11 @@ int main(int argc, const char **argv)
1038
alt = xmalloc(sizeof(*alt));
1039
alt->base = xmalloc(strlen(url) + 1);
1040
strcpy(alt->base, url);
1049
- for (path = alt->base + strlen(alt->base) - 1; *path == '/'; --path)
1050
- *path = 0;
1041
+ for (s = alt->base + strlen(alt->base) - 1; *s == '/'; --s)
1042
+ *s = 0;
1043
alt->got_indices = 0;
1044
alt->packs = NULL;
1045
alt->next = NULL;
1054
- path = strstr(url, "//");
1055
- if (path) {
1056
- path = strchr(path+2, '/');
1057
- if (path)
1058
- alt->path_len = strlen(path);
1059
- }
1046
1047
if (pull(commits, commit_id, write_ref, url))
1048
rc = 1;