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

PATCH: silient popd when PUSHD_SILENT is set.



When PUSHD_SILENT is set, the popd command will still print something
if it is given an argument.  Example:

zsh -f
% setopt PUSHD_SILENT
% pushd /etc/
% pushd /tmp
% pushd /
% popd
% popd +1
/tmp
%


This was noticed by Bart more than a decade ago in zsh-workers 2219:

  http://www.zsh.org/mla/workers/1996/msg01519.html

Though there was never a response.

I think the attached patch will fix it.

-FR.
Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.175
diff -u -r1.175 builtin.c
--- Src/builtin.c	6 Feb 2007 21:47:54 -0000	1.175
+++ Src/builtin.c	11 Feb 2007 00:17:57 -0000
@@ -1123,9 +1123,10 @@
     set_pwd_env();
 
     if (isset(INTERACTIVE)) {
-	if (unset(PUSHDSILENT) && func != BIN_CD)
-	    printdirstack();
-	else if (doprintdir) {
+	if (func != BIN_CD) {
+            if (unset(PUSHDSILENT))
+	        printdirstack();
+        } else if (doprintdir) {
 	    fprintdir(pwd, stdout);
 	    putchar('\n');
 	}


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