diff options
author | jmz <jmz@FreeBSD.org> | 1995-02-06 00:14:50 +0000 |
---|---|---|
committer | jmz <jmz@FreeBSD.org> | 1995-02-06 00:14:50 +0000 |
commit | d73fc7937416d1e21cda837d49588224d78b0730 (patch) | |
tree | c3008505807ae48a21aed8b6f8bf0d22ad7ca50f | |
parent | ddc8068fe7ea8c8fc7e3213b97bfaf01cb9fe908 (diff) | |
download | FreeBSD-src-d73fc7937416d1e21cda837d49588224d78b0730.zip FreeBSD-src-d73fc7937416d1e21cda837d49588224d78b0730.tar.gz |
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!)
-rw-r--r-- | usr.bin/sed/process.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c index 2ec8aac..1bcda6d 100644 --- a/usr.bin/sed/process.c +++ b/usr.bin/sed/process.c @@ -180,7 +180,7 @@ redirect: if (pd) break; if ((p = memchr(ps, '\n', psl)) != NULL) { - oldc = *p; + oldc = *++p; *p = '\0'; } OUT(ps) |