aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJean-Marc Zucconi <jmz@FreeBSD.org>1995-02-06 00:14:50 +0000
committerJean-Marc Zucconi <jmz@FreeBSD.org>1995-02-06 00:14:50 +0000
commit30ad8d9349289bef908ed483e81a851ecfbba908 (patch)
treec3008505807ae48a21aed8b6f8bf0d22ad7ca50f /usr.bin
parent768483b7619cd49f1b729e4a3c544d592681c434 (diff)
downloadsrc-30ad8d9349289bef908ed483e81a851ecfbba908.tar.gz
src-30ad8d9349289bef908ed483e81a851ecfbba908.zip
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!)
Notes
Notes: svn path=/head/; revision=6209
Diffstat (limited to 'usr.bin')
-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 2ec8aacc5879..1bcda6df184b 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)