From d73fc7937416d1e21cda837d49588224d78b0730 Mon Sep 17 00:00:00 2001 From: jmz Date: Mon, 6 Feb 1995 00:14:50 +0000 Subject: 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!) --- usr.bin/sed/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.bin/sed/process.c') 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) -- cgit v1.1