diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2002-04-08 17:54:21 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2002-04-08 17:54:21 +0000 |
commit | c5ebd0fad00a591c61c623f9355579fa9b247b96 (patch) | |
tree | 2fa81c8d54beeaf8c208fc40309f3ec24e3df3bb /Src | |
parent | e38adccc5da8f96d900c75d8db59faafde5682ae (diff) | |
download | zsh-c5ebd0fad00a591c61c623f9355579fa9b247b96.tar.gz zsh-c5ebd0fad00a591c61c623f9355579fa9b247b96.tar.xz zsh-c5ebd0fad00a591c61c623f9355579fa9b247b96.zip |
16942: Allow zero-length matches in parameter substitutions.
Diffstat (limited to 'Src')
-rw-r--r-- | Src/glob.c | 4 |
1 files changed, 2 insertions, 2 deletions
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)) { |