From 2eed0e2d470d7020e8bdec2a0f398a296192816b Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Mon, 15 Sep 2003 06:28:45 +0000 Subject: Add a test for the 'P' command and fix current implementation so it doesnt permanently modify the pattern space. --- editors/sed.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'editors') diff --git a/editors/sed.c b/editors/sed.c index 8c77a0f..2b01ec7 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -857,7 +857,11 @@ static void process_file(FILE * file) if (tmp) { *tmp = '\0'; + puts(pattern_space); + *tmp = '\n'; + break; } + /* Fall Through */ } case 'p': /* Write the current pattern space to output */ puts(pattern_space); -- cgit v1.1