aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/sed
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-06-10 06:06:20 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-06-10 06:06:20 +0000
commit03fef72fe9ced7bddcd40ea82adb29e262294b8b (patch)
treea350e937964012645904cc85ec698a1d55353141 /usr.bin/sed
parente2eca5fe3e60da4a579cd5f43210552413b4746b (diff)
Notes
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/process.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index 4674404d6e01..1ba80f559f54 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -360,6 +360,9 @@ substitute(cp)
s += match[0].rm_eo;
slen -= match[0].rm_eo;
lastempty = 0;
+ } else if (match[0].rm_so == slen) {
+ s += match[0].rm_so;
+ slen = 0;
} else {
if (match[0].rm_so == 0)
cspace(&SS, s, match[0].rm_so + 1,