Stay on the correct line at the end of a substitute command. From Andrew Moore.

This commit is contained in:
mycroft 1995-01-15 06:18:29 +00:00
parent 71dcdbe0d4
commit 9154deaefa

View File

@ -122,6 +122,7 @@ search_and_replace(pat, gflag, kth)
char *txt;
char *eot;
long lc;
long xa = current_addr;
int nsubs = 0;
line_t *lp;
int len;
@ -152,8 +153,10 @@ search_and_replace(pat, gflag, kth)
} while (txt != eot);
SPL0();
nsubs++;
xa = current_addr;
}
}
current_addr = xa;
if (nsubs == 0 && !(gflag & GLB)) {
sprintf(errmsg, "no match");
return ERR;