Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Cygwin/MSYS2: Trouble converting relative paths from / using :a or :A



> 2021/11/15 17:44、I wrote:

> # When is it possible that the return value of zgetcwd() ends with '/' but is not
> # equal to just "/"?

> +	char *here = zgetcwd();
> +	if (here[strlen(here)-1] != '/')
> +	    *junkptr = zhtricat(metafy(here, -1, META_HEAPDUP), "/", *junkptr);
> +	else
> +	    *junkptr = dyncat(here, *junkptr);


Now I think that the return value of zgetcwd() ('here') can end with '/'
only if strlen(here)==1, so we need not metafy 'here'.
Am I correct?

The same code appears at lines 932 of hist.c, and line 4501 of subst.c.



Messages sorted by: Reverse Date, Date, Thread, Author