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

RE: zsh breaks configure scripts



> 
> 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!
> 
> The offending code is in cd_new_pwd() in Src/builtins.c around line
1047:
>     if (unset(PUSHDSILENT) && func != BIN_CD && isset(INTERACTIVE))
>          printdirstack();
>      else if (doprintdir) {
>          fprintdir(pwd, stdout);
>          putchar('\n');
>      }
> 
> I suggest that the fprintdir/putchar be called only in interactive
> shells:
>     if (unset(PUSHDSILENT) && func != BIN_CD && isset(INTERACTIVE))
>          printdirstack();
>      else if (doprintdir && isset(INTERACTIVE)) {
>          fprintdir(pwd, stdout);
>          putchar('\n');
>      }
> 

Looking at different shells here:

sh does not print anything at all

ksh and bash do not print anything is we cd relative to empty CDPATH
element (the best I can explain it):

bor@itsrm2% ksh 
$ cd
$ CDPATH=:; cd tmp
$ cd
$ CDPATH=.:/tmp; cd tmp
/home/bor/tmp
$ cd
$ CDPATH=:/tmp;cd tmp
$ cd
$ CDPATH=/tmp:; cd tmp
$ exit

May be we should just follow the suite?

-andrej



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