Set restore point before setting signal handlers
This commit is contained in:
parent
d098ac4abc
commit
651e2b0ee2
14
ed.c
14
ed.c
|
@ -1368,7 +1368,6 @@ sighup(int dummy)
|
||||||
static void
|
static void
|
||||||
edit(void)
|
edit(void)
|
||||||
{
|
{
|
||||||
setjmp(savesp);
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
newcmd = 1;
|
newcmd = 1;
|
||||||
ocurln = curln;
|
ocurln = curln;
|
||||||
|
@ -1388,8 +1387,6 @@ init(char *fname)
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
if (setjmp(savesp))
|
|
||||||
return;
|
|
||||||
setscratch();
|
setscratch();
|
||||||
if (!fname)
|
if (!fname)
|
||||||
return;
|
return;
|
||||||
|
@ -1418,11 +1415,12 @@ main(int argc, char *argv[])
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
signal(SIGINT, sigintr);
|
if (!setjmp(savesp)) {
|
||||||
signal(SIGHUP, sighup);
|
signal(SIGINT, sigintr);
|
||||||
signal(SIGQUIT, SIG_IGN);
|
signal(SIGHUP, sighup);
|
||||||
|
signal(SIGQUIT, SIG_IGN);
|
||||||
init(*argv);
|
init(*argv);
|
||||||
|
}
|
||||||
edit();
|
edit();
|
||||||
|
|
||||||
/* not reached */
|
/* not reached */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user