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

Re: zsh breaks configure scripts



Eric Norum wrote:
> Apple uses zsh as /bin/sh on Mac OS X.  Unfortunately zsh has a 
> `feature' that breaks many autoconf configure scripts.  The scripts 
> contain lines like:
> if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && .......
> 
> The problem is that the zsh cd command insists on printing the directory!
> I suggest that the fprintdir/putchar be called only in interactive 
> shells:

That looks fine.  I'll put this on the 4.0 line, too.  It could be made
an option, but it's not really worth it.  It's a bit of a nasty hack to
inform the user which directory they're going into if it's not obvious.
This seems to cover the likely problems without hurting anyone.

Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.70
diff -u -r1.70 builtin.c
--- Src/builtin.c	22 Feb 2002 21:59:43 -0000	1.70
+++ Src/builtin.c	4 Mar 2002 15:22:52 -0000
@@ -1059,11 +1059,13 @@
     pwd = new_pwd;
     set_pwd_env();
 
-    if (unset(PUSHDSILENT) && func != BIN_CD && isset(INTERACTIVE))
-	printdirstack();
-    else if (doprintdir) {
-	fprintdir(pwd, stdout);
-        putchar('\n');
+    if (isset(INTERACTIVE)) {
+	if (unset(PUSHDSILENT) && func != BIN_CD)
+	    printdirstack();
+	else if (doprintdir) {
+	    fprintdir(pwd, stdout);
+	    putchar('\n');
+	}
     }
 
     /* execute the chpwd function */

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************



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