zsh-workers
 help / color / mirror / code / Atom feed
From: "Felix Rosencrantz" <f.rosencrantz@gmail.com>
To: "Zsh hackers list" <zsh-workers@sunsite.dk>
Subject: PATCH: silient popd when PUSHD_SILENT is set.
Date: Sat, 10 Feb 2007 16:23:12 -0800	[thread overview]
Message-ID: <dc507f4a0702101623v9f87e2eq494be152af178b13@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

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.

[-- Attachment #2: builtin_patch.txt --]
[-- Type: text/plain, Size: 624 bytes --]

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');
 	}

                 reply	other threads:[~2007-02-11  0:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=dc507f4a0702101623v9f87e2eq494be152af178b13@mail.gmail.com \
    --to=f.rosencrantz@gmail.com \
    --cc=zsh-workers@sunsite.dk \
    /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).