git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] http-fetch: remove path_len from struct alt_base, it was computed but never used

From
Gerrit Pape <pape@smarden.org>
Date
Mar 28, 2007, 09:47 UTC
Message-ID
<20070328094735.32395.qmail@f0b3463ad4d11a.315fe32.mid.smarden.org>
In-Reply-To
<20070328094615.32277.qmail@47bcc7bfa0b709.315fe32.mid.smarden.org>
Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 http-fetch.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/http-fetch.c b/http-fetch.c
index 58b77a7..557b403 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -17,7 +17,6 @@ static struct curl_slist *no_pragma_header;
 struct alt_base
 {
 	char *base;
-	int path_len;
 	int got_indices;
 	struct packed_git *packs;
 	struct alt_base *next;
@@ -515,7 +514,6 @@ static void process_alternates_response(void *callback_data)
 			int serverlen = 0;
 			struct alt_base *newalt;
 			char *target = NULL;
-			char *path;
 			if (data[i] == '/') {
 				/* This counts
 				 * http://git.host/pub/scm/linux.git/
@@ -583,12 +581,6 @@ static void process_alternates_response(void *callback_data)
 				newalt->base = target;
 				newalt->got_indices = 0;
 				newalt->packs = NULL;
-				path = strstr(target, "//");
-				if (path) {
-					path = strchr(path+2, '/');
-					if (path)
-						newalt->path_len = strlen(path);
-				}
 
 				while (tail->next != NULL)
 					tail = tail->next;
@@ -999,7 +991,7 @@ int main(int argc, const char **argv)
 	const char **write_ref = NULL;
 	char **commit_id;
 	const char *url;
-	char *path;
+	char *s;
 	int arg = 1;
 	int rc = 0;
 
@@ -1046,17 +1038,11 @@ int main(int argc, const char **argv)
 	alt = xmalloc(sizeof(*alt));
 	alt->base = xmalloc(strlen(url) + 1);
 	strcpy(alt->base, url);
-	for (path = alt->base + strlen(alt->base) - 1; *path == '/'; --path)
-		*path = 0;
+	for (s = alt->base + strlen(alt->base) - 1; *s == '/'; --s)
+		*s = 0;
 	alt->got_indices = 0;
 	alt->packs = NULL;
 	alt->next = NULL;
-	path = strstr(url, "//");
-	if (path) {
-		path = strchr(path+2, '/');
-		if (path)
-			alt->path_len = strlen(path);
-	}
 
 	if (pull(commits, commit_id, write_ref, url))
 		rc = 1;
-- 
1.5.1-rc2.GIT
Previous: Gerrit Pape
Message 2 of 2 in “http-fetch: don't use double-slash as directory separator in URLs”
  1. http-fetch: don't use double-slash as directory separator in URLsGerrit Pape, Mar 28, 2007
  2. http-fetch: remove path_len from struct alt_base, it was computed but never usedGerrit Pape, Mar 28, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.