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:
parent
768483b761
commit
30ad8d9349
@ -180,7 +180,7 @@ process()
|
||||
if (pd)
|
||||
break;
|
||||
if ((p = memchr(ps, '\n', psl)) != NULL) {
|
||||
oldc = *p;
|
||||
oldc = *++p;
|
||||
*p = '\0';
|
||||
}
|
||||
OUT(ps)
|
||||
|
Loading…
Reference in New Issue
Block a user