A test and fix for the sed 'n' command
diff --git a/editors/sed.c b/editors/sed.c
index 00ed208..8c77a0f 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -985,11 +985,19 @@
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 */