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

Re: [PATCH] POSIX_CD: disable stack entries



On Thu, 2019-12-12 at 11:38 +0100, Martijn Dekker wrote:
> Recognising directory stack entries for the 'cd' builtin is not 
> compatible with POSIX, because cd'ing into directories with names like 
> +123 or -4567 no longer works without prefixing './', even after '--'. 
> In POSIX, only the '-' operand has such a special meaning. The attached 
> patch disables directory stack entries for 'cd' if POSIX_CD is active.
> 
> This patch also changes the behaviour of the 'chdir' equivalent. For 
> POSIX compliance, only 'cd' needs to be changed, as POSIX has no 
> 'chdir'. I could change the patch to only change 'cd', but it would 
> involve slightly more code, and would make 'cd' and 'chdir' no longer 
> exactly equivalent. If this is preferred, please let me know.

Thanks, that sounds perfectly reasonable and I've committed it.

The intention of the POSIX options is entirely in accord with your
own --- make this clean and simple, with minimal confusion
with the clever stuff the shell does the rest of the time.

pws



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