Commit 9ed47db
authored
ed: buffer is dirty unless all lines were written
* I found a case where ed allowed unsaved changes to be lost
* The default behaviour of "w" command is to write all lines from the editor buffer
* In the case of 1w or 1,2w command, only the selected lines are written and there may be unsaved changes on other lines, so don't unset the "dirty" flag
* The flag should be unmodified also in the case of "w !cat", where all buffer lines are written to a pipe
* This patch makes ed consistent with BSD and GNU versions1 parent 28dcd04 commit 9ed47db
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
682 | | - | |
683 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
684 | 688 | | |
685 | 689 | | |
686 | 690 | | |
| |||
0 commit comments