about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2014-06-04 22:47:20 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2014-06-04 22:47:20 -0700
commit69378db3c53cea12d8c5f20380de5017e4e72611 (patch)
treeada7373380c4d7dc552c9ebc0cbe9cecc814aef2 /Src
parent9381bb6a2d3abd4a4c6871b5676f9fb04f42d921 (diff)
downloadzsh-69378db3c53cea12d8c5f20380de5017e4e72611.tar.gz
zsh-69378db3c53cea12d8c5f20380de5017e4e72611.tar.xz
zsh-69378db3c53cea12d8c5f20380de5017e4e72611.zip
32708: glob qualifier (Y) implies (oN)
plus incidental patch to avoid adding a meaningless bitvalue to sort-order flags
Diffstat (limited to 'Src')
-rw-r--r--Src/glob.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Src/glob.c b/Src/glob.c
index c74a56053..c6cb3d2fc 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -1619,9 +1619,10 @@ zglob(LinkList list, LinkNode np, int nountok)
 			restore_globstate(saved);
 			return;
 		    }
+		    if ((sense & 2) &&
+			(t & (GS_SIZE|GS_ATIME|GS_MTIME|GS_CTIME|GS_LINKS)))
+			t <<= GS_SHIFT; /* HERE: GS_EXEC? */
 		    if (t != GS_EXEC) {
-			if ((sense & 2) && !(t & (GS_NAME|GS_DEPTH)))
-			    t <<= GS_SHIFT; /* HERE: GS_EXEC? */
 			if (gf_sorts & t) {
 			    zerr("doubled sort specifier");
 			    restore_globstate(saved);
@@ -1779,7 +1780,7 @@ zglob(LinkList list, LinkNode np, int nountok)
 	return;
     }
     if (!gf_nsorts) {
-	gf_sortlist[0].tp = gf_sorts = GS_NAME;
+	gf_sortlist[0].tp = gf_sorts = (shortcircuit ? GS_NONE : GS_NAME);
 	gf_nsorts = 1;
     }
     /* Initialise receptacle for matched files, *