1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-30 07:10:58 +02:00

16942: Allow zero-length matches in parameter substitutions.

This commit is contained in:
Peter Stephenson 2002-04-09 09:23:30 +00:00
parent 0b95ec1bd3
commit 5ec48c8510
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2002-04-09 Peter Stephenson <pws@csr.com>
* 16942: Src/glob.c: Allow zero-length matches in parameter
substitutions.
2002-04-04 Clint Adams <clint@zsh.org>
* 16934: Completion/Unix/Command/_ssh: complete -1 as well as -2.

View file

@ -2172,7 +2172,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;
@ -2252,7 +2252,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)) {