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

Re: [PATCH] builtin-clone: Use is_dir_sep() instead of '/'

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 19, 2008, 00:32 UTC
Message-ID
<7vk5fi67dx.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1216366485-12201-3-git-send-email-johannes.sixt@telecom.at>
Johannes Sixt <johannes.sixt@telecom.at> writes:
Show 18 quoted lines
> Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
> ---
>  builtin-clone.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/builtin-clone.c b/builtin-clone.c
> index 643c7d4..fddf47f 100644
> --- a/builtin-clone.c
> +++ b/builtin-clone.c
> @@ -115,7 +115,7 @@ static char *guess_dir_name(const char *repo, int is_bundle)
>  			if (!after_slash_or_colon)
>  				end = p;
>  			p += 7;
> -		} else if (*p == '/' || *p == ':') {
> +		} else if (is_dir_sep(*p) || *p == ':') {
>  			if (end == limit)
>  				end = p;
>  			after_slash_or_colon = 1;
Ok, but the surrounding code in this function look very suspicious.
 * The variable "prefix" is actually about suffix.
 * "else if" for explicit ".bundle" case look redundant; it would never
   trigger, I suspect.
 * Values used to increment p for "prefix" case and ".bundle" case are
   inconsistent.  I think the redundant one increments by the right value
   (i.e. strlen(prefix)-1 is bogus).
Previous: Johannes SixtNext: Johannes Sixt
Message 11 of 16 in “Windows related patches”
  1. Windows related patchesJohannes Sixt, Jul 18, 2008
  2. Teach lookup_prog not to select directoriesJohannes Sixt, Jul 18, 2008
  3. builtin-clone: Use is_dir_sep() instead of '/'Johannes Sixt, Jul 18, 2008
  4. Add ANSI control code emulation for the Windows consoleJohannes Sixt, Jul 18, 2008
  5. Windows: set gitexecdir = $(bindir)Johannes Sixt, Jul 18, 2008
  6. Junio C HamanoJul 19, 2008
  7. Johannes SixtJul 19, 2008
  8. Steffen ProhaskaJul 19, 2008
  9. Junio C HamanoJul 19, 2008
  10. Johannes SixtJul 19, 2008
  11. Junio C HamanoJul 19, 2008
  12. Johannes SixtJul 19, 2008
  13. Johannes SchindelinJul 19, 2008
  14. Johannes SixtJul 19, 2008
  15. Daniel BarkalowJul 19, 2008
  16. Kristian HøgsbergJul 21, 2008

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.