about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/glob.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e45916870..5482183aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-08  Peter Stephenson  <pws@csr.com>
+
+	* 16942: Src/glob.c: Allow zero-length matches in parameter
+	substitutions.
+
 2002-04-04  Oliver Kiddle  <opk@zsh.org>
 
 	* 16935: Completion/Unix/Command/_ssh: update list of options
diff --git a/Src/glob.c b/Src/glob.c
index 75509fee5..443262dc4 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -2291,7 +2291,7 @@ igetmatch(char **sp, Patprog p, int fl, int n, char *replstr)
 		for (; t < s + l; t++, patoffset++) {
 		    /* Find the longest match from this position. */
 		    set_pat_start(p, t-s);
-		    if (pattry(p, t) && patinput > t) {
+		    if (pattry(p, t)) {
 			char *mpos = patinput;
 			if (!(fl & SUB_LONG) && !(p->flags & PAT_PURES)) {
 			    char *ptr;
@@ -2371,7 +2371,7 @@ igetmatch(char **sp, Patprog p, int fl, int n, char *replstr)
 		if (t > s && t[-1] == Meta)
 		    t--;
 		set_pat_start(p, t-s);
-		if (pattry(p, t) && patinput > t && !--n) {
+		if (pattry(p, t) && !--n) {
 		    /* Found the longest match */
 		    char *mpos = patinput;
 		    if (!(fl & SUB_LONG) && !(p->flags & PAT_PURES)) {