zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] Functions/Misc/relative: use -q with cd
Date: Sat, 29 Apr 2017 17:07:00 +0000	[thread overview]
Message-ID: <20170429170700.GA14300@fujitsu.shahaf.local2> (raw)
In-Reply-To: <20170427203537.13535-1-genml+zsh-workers@thequod.de>

Daniel Hahler wrote on Thu, Apr 27, 2017 at 22:35:37 +0200:
> +++ b/Functions/Misc/relative
> @@ -8,8 +8,8 @@ emulate -L zsh || return 1
> -1=$(cd $1; pwd -r)
> -2=$(cd $2; pwd -r)
> +1=$(cd -q $1; pwd -r)
> +2=$(cd -q $2; pwd -r)

Would «1=${1:P}» be equivalent?  (If it is, it saves a fork.)

Pre-existing problem: should the function check that cd succeeded?  It
already checked that $1 and $2 exist, but they might be unreadable/unexecutable
by the EUID.


  reply	other threads:[~2017-04-29 17:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27 20:35 Daniel Hahler
2017-04-29 17:07 ` Daniel Shahaf [this message]
2017-04-29 19:47   ` Bart Schaefer
2017-06-22 20:32   ` Daniel Hahler
2017-06-22 23:39     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170429170700.GA14300@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).