ed: Simplify sighup dealing - sbase - suckless unix tools | |
git clone git://git.suckless.org/sbase | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit bbdd7bedc464fb2a4c39c6afe40e79c4e5071e15 | |
parent 137f0917e48c5572ad7de889944af6b10f3c1035 | |
Author: Roberto E. Vargas Caballero <[email protected]> | |
Date: Wed, 6 Dec 2023 11:48:18 +0100 | |
ed: Simplify sighup dealing | |
As we already have the dump() function we can move the | |
modification check inside the new dump() function. | |
Diffstat: | |
M ed.c | 6 ++++-- | |
1 file changed, 4 insertions(+), 2 deletions(-) | |
--- | |
diff --git 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(); | |
} | |