Stop matching when lastmatch points to '\n'

This situation happens with something like s/$/test/,
where rm_so == rm_eo == 0. Without this check, ed
keeps looping forever.
1 file changed