diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/sed.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/editors/sed.c b/editors/sed.c index 5fe4356..78d4609 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -848,8 +848,11 @@ static void process_file(FILE *file) } break; case 'q': /* Branch to end of script and quit */ - free(line); - return; + deleted = 1; + /* Exit the outer while loop */ + free(next_line); + next_line = NULL; + break; case 'n': /* Read next line from input */ free(line); line = next_line; |