summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed
diff options
context:
space:
mode:
authorjmz <jmz@FreeBSD.org>1995-02-06 00:14:50 +0000
committerjmz <jmz@FreeBSD.org>1995-02-06 00:14:50 +0000
commitd73fc7937416d1e21cda837d49588224d78b0730 (patch)
treec3008505807ae48a21aed8b6f8bf0d22ad7ca50f /usr.bin/sed
parentddc8068fe7ea8c8fc7e3213b97bfaf01cb9fe908 (diff)
downloadFreeBSD-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!)
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/process.c2
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)
OpenPOWER on IntegriCloud