diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/sed.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) | |||
985 | next_line = NULL; | 985 | next_line = NULL; |
986 | break; | 986 | break; |
987 | case 'n': /* Read next line from input */ | 987 | case 'n': /* Read next line from input */ |
988 | if (!be_quiet) { | ||
989 | puts(pattern_space); | ||
990 | } | ||
988 | if (next_line) { | 991 | if (next_line) { |
989 | free(pattern_space); | 992 | free(pattern_space); |
990 | pattern_space = next_line; | 993 | pattern_space = next_line; |
991 | next_line = bb_get_chomped_line_from_file(file); | 994 | next_line = bb_get_chomped_line_from_file(file); |
992 | linenum++; | 995 | linenum++; |
996 | } else { | ||
997 | /* Jump to end of script and exist */ | ||
998 | deleted = 1; | ||
999 | free(next_line); | ||
1000 | next_line = NULL; | ||
993 | } | 1001 | } |
994 | break; | 1002 | break; |
995 | case 'N': /* Append the next line to the current line */ | 1003 | case 'N': /* Append the next line to the current line */ |