call to addpre() in every iteration of subline()
It is needed to call to addpre(), because in other case the prefix of all the occurrences before the target will not be copied to the result string.
This commit is contained in:
parent
3e130cee66
commit
694a5ef7fb
2
ed.c
2
ed.c
|
@ -991,10 +991,10 @@ subline(int num, int nth)
|
||||||
|
|
||||||
siz = 0;
|
siz = 0;
|
||||||
for (m = match(num); m; m = rematch(num)) {
|
for (m = match(num); m; m = rematch(num)) {
|
||||||
|
addpre(&s, &cap, &siz);
|
||||||
if (--nth > 0)
|
if (--nth > 0)
|
||||||
continue;
|
continue;
|
||||||
changed = 1;
|
changed = 1;
|
||||||
addpre(&s, &cap, &siz);
|
|
||||||
addsub(&s, &cap, &siz);
|
addsub(&s, &cap, &siz);
|
||||||
if (nth == 0)
|
if (nth == 0)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user