Correct a bug in the P function: according to 7th edition UNIX (tm), the

newline must be part of the pattern space i.e. `echo a|sed -e P' must print
a
a
and not
aa
This is consistent with gnu sed, SunOS, Ultrix (and probably others!)
This commit is contained in:
Jean-Marc Zucconi 1995-02-06 00:14:50 +00:00
parent 768483b761
commit 30ad8d9349

View File

@ -180,7 +180,7 @@ process()
if (pd)
break;
if ((p = memchr(ps, '\n', psl)) != NULL) {
oldc = *p;
oldc = *++p;
*p = '\0';
}
OUT(ps)