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

PATCH: ~-num expansion.



Z(2):akr@is27e1u11% zsh-3.1.5-pws-22 -f
is27e1u11% dirs -v
0       ~/zsh/zsh-3.1.5-pws-22
is27e1u11% echo ~-0
zsh: not enough directory stack entries.
is27e1u11% 

zsh should expand ~-0.

--- Src/subst.c-	Tue Jun 15 01:14:31 1999
+++ Src/subst.c	Tue Jun 15 21:58:24 1999
@@ -1944,6 +1944,8 @@
     else
 	for (end=NULL, n=firstnode(dirstack); n && val; val--, n=nextnode(n));
     if (n == end) {
+	if (backwards && !val)
+	    return pwd;
 	if (isset(NOMATCH))
 	    zerr("not enough directory stack entries.", NULL, 0);
 	return NULL;

-- 
Tanaka Akira



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