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

Re: [PATCH/RFC] t0060: basename("//") is implementation defined

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 13, 2016, 21:16 UTC
Message-ID
<xmqqegdlmb7f.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1452718561-32226-1-git-send-email-tboegi@web.de>
tboegi@web.de writes:
Show 15 quoted lines
> From: Torsten Bögershausen <tboegi@web.de>
>
> From
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/basename.html
> basename("//") may return either "//" or "/".
>
> Linux returns "/", some systems like Mac OS X return "//".
> Skip the test unless NO_LIBGEN_H is set and gitbasename() from
> compat/basename is used.
>
> Signed-off-by: Torsten Bögershausen <tboegi@web.de>
> ---
> My version of a hot fix
>  test-path-utils.c | 2 ++
>  1 file changed, 2 insertions(+)
Thanks.  Ramsay gave a nice analysis at
  http://thread.gmane.org/gmane.comp.version-control.git/283928

and Dscho already is working on it, IIUC, in a slightly different direction.

Show 14 quoted lines
> diff --git a/test-path-utils.c b/test-path-utils.c
> index 4ab68ac..db0bb39 100644
> --- a/test-path-utils.c
> +++ b/test-path-utils.c
> @@ -142,7 +142,9 @@ static struct test_data dirname_data[] = {
>  	{ ".",               "."      },
>  	{ "..",              "."      },
>  	{ "/",               "/"      },
> +#if defined(NO_LIBGEN_H)
>  	{ "//",              "//"     },
> +#endif
>  #if defined(__CYGWIN__) && !defined(NO_LIBGEN_H)
>  	{ "///",             "//"     },
>  	{ "////",            "//"     },
Previous: tboegi@web.deNext: Johannes Schindelin
Message 2 of 4 in “t0060: basename("//") is implementation defined”
  1. t0060: basename("//") is implementation definedtboegi@web.de, Jan 13, 2016
  2. Junio C HamanoJan 13, 2016
  3. Johannes SchindelinJan 14, 2016
  4. Torsten BögershausenJan 14, 2016

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.