From: Glenn L McGrath Date: Fri, 28 Mar 2003 04:57:52 +0000 (-0000) Subject: fix q command X-Git-Tag: 1_00_pre1~144 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b08e3e8c2e1334ba00df7d818b586815b328a4b0;p=oweals%2Fbusybox.git fix q command --- diff --git a/editors/sed.c b/editors/sed.c index 5fe435622..78d46091f 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;