summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2014-07-31 23:46:21 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2014-07-31 23:46:21 -0700
commit417cb94fe147a94d16e3935deb83250a51cd62a8 (patch)
tree0bda85eaecf6cacba26d6b1fd5a098c8abea9290
parent51c0ccd303d48673472c9f12524185e04a8a732b (diff)
downloadzsh-417cb94fe147a94d16e3935deb83250a51cd62a8.tar.gz
zsh-417cb94fe147a94d16e3935deb83250a51cd62a8.tar.xz
zsh-417cb94fe147a94d16e3935deb83250a51cd62a8.zip
32931: with NO_NOMATCH, a subscript glob qualifier on a not-matching pattern returns the original pattern
-rw-r--r--ChangeLog6
-rw-r--r--Src/glob.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index e861e0d90..ccad0d1ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-07-31  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 32931: Src/glob.c: with NO_NOMATCH, using a subscript glob
+	qualifier on a not-matching pattern should still return the
+	original pattern
+
 2014-07-30  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* unposted: Src/Builtins/sched.c, Src/Modules/datetime.c,
diff --git a/Src/glob.c b/Src/glob.c
index 1e9195049..627166c7a 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -1906,6 +1906,8 @@ zglob(LinkList list, LinkNode np, int nountok)
 		matchptr++;
 	    }
 	}
+    } else if (!badcshglob && !isset(NOMATCH) && matchct == 1) {
+	insert_glob_match(list, node, (--matchptr)->name);
     }
     free(matchbuf);