From 6e5687abc3732fac6d8a43a324b8f284f7a5482d Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Mon, 15 Sep 2003 06:12:53 +0000 Subject: A test and fix for the sed 'n' command --- editors/sed.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'editors/sed.c') diff --git a/editors/sed.c b/editors/sed.c index 00ed20892..8c77a0ffc 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -985,11 +985,19 @@ static void process_file(FILE * file) next_line = NULL; break; case 'n': /* Read next line from input */ + if (!be_quiet) { + puts(pattern_space); + } if (next_line) { free(pattern_space); pattern_space = next_line; next_line = bb_get_chomped_line_from_file(file); linenum++; + } else { + /* Jump to end of script and exist */ + deleted = 1; + free(next_line); + next_line = NULL; } break; case 'N': /* Append the next line to the current line */ -- cgit v1.2.3