commit bbdd7bedc464fb2a4c39c6afe40e79c4e5071e15 Author: Roberto E. Vargas Caballero <k...@shike2.com> AuthorDate: Wed Dec 6 11:48:18 2023 +0100 Commit: Roberto E. Vargas Caballero <k...@shike2.com> CommitDate: Thu Dec 28 17:19:47 2023 +0100
ed: Simplify sighup dealing As we already have the dump() function we can move the modification check inside the new dump() function. diff --git a/ed.c b/ed.c index eaa4ca9..0705beb 100644 --- a/ed.c +++ b/ed.c @@ -710,6 +710,9 @@ dump(void) { char *home; + if (modflag) + return; + line1 = nextln(0); line2 = lastln; @@ -730,9 +733,8 @@ static void chksignals(void) { if (hup) { - if (modflag) - dump(); exstatus = 1; + dump(); quit(); }