fix q command
authorGlenn L McGrath <bug1@ihug.co.nz>
Fri, 28 Mar 2003 04:57:52 +0000 (04:57 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Fri, 28 Mar 2003 04:57:52 +0000 (04:57 -0000)
editors/sed.c

index 5fe435622b633d155360e43f911a849a00c612e2..78d46091fb3d8f8f8c196747591600207154a156 100644 (file)
@@ -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;