commit 694a5ef7fbca54581a431a528972509c5a2e8bc0
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Wed Dec 16 20:18:09 2015 +0100
Commit: sin <[email protected]>
CommitDate: Wed Dec 16 20:16:12 2015 +0000
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.
diff --git a/ed.c b/ed.c
index 33b4837..c060e5f 100644
--- a/ed.c
+++ b/ed.c
@@ -991,10 +991,10 @@ subline(int num, int nth)
siz = 0;
for (m = match(num); m; m = rematch(num)) {
+ addpre(&s, &cap, &siz);
if (--nth > 0)
continue;
changed = 1;
- addpre(&s, &cap, &siz);
addsub(&s, &cap, &siz);
if (nth == 0)
break;