ed: Simplify sighup dealing

As we already have the dump() function we can move the
modification check inside the new dump() function.
This commit is contained in:
Roberto E. Vargas Caballero 2023-12-06 11:48:18 +01:00
parent 137f0917e4
commit bbdd7bedc4
1 changed files with 4 additions and 2 deletions

6
ed.c
View File

@ -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();
}