summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed/process.c
diff options
context:
space:
mode:
authorkrion <krion@FreeBSD.org>2006-05-27 19:32:28 +0000
committerkrion <krion@FreeBSD.org>2006-05-27 19:32:28 +0000
commit89da8ff1e0fe66070fd43d9c3f0d8590646dfa0b (patch)
treeb20c3beda2624fbb8448a03cf10832747a2d393a /usr.bin/sed/process.c
parent6b57f065966c0f0801af6e04177d20713f95edbb (diff)
downloadFreeBSD-src-89da8ff1e0fe66070fd43d9c3f0d8590646dfa0b.zip
FreeBSD-src-89da8ff1e0fe66070fd43d9c3f0d8590646dfa0b.tar.gz
Fix using "P" command on empty pattern space. If the "P" command is
used once on a non-empty pattern space and then again on an empty pattern space, the second usage restores the pattern space length to the length that it had when the first "P" was used. PR: bin/96052 Submitted by: Andrey Zholos <aaz@althenia.net> MFC after: 7 days
Diffstat (limited to 'usr.bin/sed/process.c')
-rw-r--r--usr.bin/sed/process.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index ffdb629..ce401bd 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -188,8 +188,7 @@ redirect:
case 'P':
if (pd)
break;
- if (psl != 0 &&
- (p = memchr(ps, '\n', psl)) != NULL) {
+ if ((p = memchr(ps, '\n', psl)) != NULL) {
oldpsl = psl;
psl = p - ps;
}
OpenPOWER on IntegriCloud