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

[PATCH] Don't fail in http-pull if URL is missing a '/' at the end

From
AGAndreas Gal <gal@uci.edu>
Date
Apr 25, 2005, 16:21 UTC
Message-ID
<Pine.LNX.4.58.0504250917110.9176@sam.ics.uci.edu>
In-Reply-To
<E1DQ5nn-0003au-QN@be1.7eggert.dyndns.org>

http-pull fails if the URL doesn't end with a '/'. This patch adds one if needed.

Signed-off-by: Andreas Gal <gal@uci.edu>

--- http-pull.c 2005-04-25 09:15:45.000000000 -0700 +++ /home/gal/src/git/git-bit/http-pull.c 2005-04-25 09:09:54.000000000 -0700

@@ -76,6 +76,8 @@
 	url = malloc(strlen(base) + 50);
 	strcpy(url, base);
 	posn = url + strlen(base);
+	if (posn[-1] != '/')
+		*posn++ = '/';
 	strcpy(posn, "objects/");
 	posn += 8;
 	memcpy(posn, hex, 2);
Previous: Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>
Message 2 of 2 in “Re: Git-commits mailing list feed.”
  1. Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>Apr 25, 2005
  2. Don't fail in http-pull if URL is missing a '/' at the endAndreas Gal, Apr 25, 2005

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.