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

[PATCH] Functions/Misc/relative: use -q with cd



From: Daniel Hahler <git@xxxxxxxxxx>

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



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