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

Re: _canonical_path not working on *BSD



Bart Schaefer wrote:
> On Mar 26, 11:44am, Baptiste Daroussin wrote:
> }
> } _canonical_path is not working on freebsd, it rely on readlink
> 
> Try this.  I don't actually have any mount points that are symlink
> targets so it's hard to test, but I think this is right:
> 
> -if (( ! $+commands[readlink] )); then
> +if ! zmodload -F zsh/stat b:zstat 2>/dev/null; then

That's probably a better solution; it doesn't necessarily work on all
systems, particularly if the shell is statically linked, but it should
be at least as widely applicable as, and easier to test for than,
anything involving readlink.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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