From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19055 invoked by alias); 27 Apr 2017 20:43:20 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41018 Received: (qmail 26742 invoked from network); 27 Apr 2017 20:43:20 -0000 X-Qmail-Scanner-Diagnostics: from hahler.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(188.40.33.212):SA:0(0.0/5.0):. Processed in 1.293688 secs); 27 Apr 2017 20:43:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RP_MATCHES_RCVD,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: daniel@hahler.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.hahler.de designates 188.40.33.212 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h= x-mailer:message-id:date:date:subject:subject:from:from:received :received:received; s=postfix2; t=1493325339; bh=oKE2P/VQhSUmk7C PfHfL2yOYqEN3h80b9U1Z0kn3AI0=; b=DF4ntnQ4L6zwfose0GfBvIlqriNQGpZ v86hkH7GuhfZcJFOn6IQyVLEudrKBioM34azmeoiyWRLk+IhQwxIkBkgGo4PU/gB TySaMQ/6JPcUze9N3ekXXXC0x5AEMVt/7Zh0B6I/v+mCb534SYlYfZZM2fBdnJPi OUV5juLCK5tE= From: Daniel Hahler To: zsh-workers@zsh.org Subject: [PATCH] Functions/Misc/relative: use -q with cd Date: Thu, 27 Apr 2017 22:35:37 +0200 Message-Id: <20170427203537.13535-1-genml+zsh-workers@thequod.de> X-Mailer: git-send-email 2.12.2 From: Daniel Hahler This skips chpwd function(s), which only add overhead and might cause unwanted side-effects. --- Functions/Misc/relative | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Functions/Misc/relative b/Functions/Misc/relative index 432f2e2da..db3b5a587 100644 --- a/Functions/Misc/relative +++ b/Functions/Misc/relative @@ -8,8 +8,8 @@ emulate -L zsh || return 1 [[ $1 -ef $2 ]] && print ${3:-.} && return # The simplest way to eliminate symlinks and ./ and ../ in the paths: -1=$(cd $1; pwd -r) -2=$(cd $2; pwd -r) +1=$(cd -q $1; pwd -r) +2=$(cd -q $2; pwd -r) local -a cur abs cur=(${(s:/:)2}) # Split 'current' directory into cur -- 2.12.2