mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-30 15:02:18 +01:00
15277: Src/glob.c: real backreferencing bug with ${(S)...%%...}
This commit is contained in:
parent
40e17d980f
commit
4a8b8bd752
2 changed files with 12 additions and 8 deletions
|
@ -1,5 +1,8 @@
|
|||
2001-07-06 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 15277: Src/glob.c: *real* bug with ${(S)...%%...}: the indices
|
||||
for start and end of backreferences were incorrect.
|
||||
|
||||
* Back out 15266: it was right before, I was looking at it
|
||||
back to front.
|
||||
|
||||
|
|
|
@ -2236,16 +2236,17 @@ igetmatch(char **sp, Patprog p, int fl, int n, char *replstr)
|
|||
break;
|
||||
|
||||
case (SUB_END|SUB_SUBSTR):
|
||||
/* Shortest at end with substrings */
|
||||
case (SUB_END|SUB_LONG|SUB_SUBSTR):
|
||||
/* Longest/shortest at end, matching substrings. */
|
||||
patoffset = ml;
|
||||
if (!(fl & SUB_LONG)) {
|
||||
set_pat_start(p, l);
|
||||
if (pattry(p, s + l) && !--n) {
|
||||
*sp = get_match_ret(*sp, l, l, fl, replstr);
|
||||
patoffset = 0;
|
||||
return 1;
|
||||
} /* fall through */
|
||||
case (SUB_END|SUB_LONG|SUB_SUBSTR):
|
||||
/* Longest/shortest at end, matching substrings. */
|
||||
}
|
||||
}
|
||||
patoffset--;
|
||||
for (t = s + l - 1; t >= s; t--, patoffset--) {
|
||||
if (t > s && t[-1] == Meta)
|
||||
|
|
Loading…
Reference in a new issue