zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Functions/Misc/relative: use -q with cd
@ 2017-04-27 20:35 Daniel Hahler
  2017-04-29 17:07 ` Daniel Shahaf
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Hahler @ 2017-04-27 20:35 UTC (permalink / raw)
  To: zsh-workers

From: Daniel Hahler <git@thequod.de>

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-22 23:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27 20:35 [PATCH] Functions/Misc/relative: use -q with cd Daniel Hahler
2017-04-29 17:07 ` Daniel Shahaf
2017-04-29 19:47   ` Bart Schaefer
2017-06-22 20:32   ` Daniel Hahler
2017-06-22 23:39     ` Bart Schaefer

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).