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
This commit is contained in:
Kirill Ponomarev 2006-05-27 19:32:28 +00:00
parent 5a890aac57
commit 85184b8b23

View File

@ -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;
}