Stay on the correct line at the end of a substitute command. From Andrew Moore.
This commit is contained in:
parent
71dcdbe0d4
commit
9154deaefa
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user