commit 694a5ef7fbca54581a431a528972509c5a2e8bc0
parent 3e130cee6698c3c3f95468a7b8a4e782ea474338
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 16 Dec 2015 20:18:09 +0100
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.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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;