Path: utzoo!attcan!uunet!mcsun!hp4nl!star.cs.vu.nl!rob@cs.vu.nl From: rob@cs.vu.nl (Rob van Leeuwen) Newsgroups: comp.os.minix Subject: Patches for Elvis (signals & isascii) Keywords: elvis, patches, signals, isascii Message-ID: <5366@star.cs.vu.nl> Date: 12 Feb 90 16:58:49 GMT Sender: news@cs.vu.nl Reply-To: valke@psy.vu.nl.UUCP (Peter Valkenburg) Organization: Fac. Wiskunde & Informatica, VU, Amsterdam Lines: 136 Hi there, below some patches are included for Elvis. They have been approved of by the author of Elvis, Steve Kirkendall. They fix the signal handling of elvis for shell-escapes and the like (the ':sh', ':!' and '!' commands in particular). This should stop Elvis from crashing on repeated keyboard interrupts. On Steve's request I have also included a small patch to the infamous isascii() macro. Peter Valkenburg (valke@psy.vu.nl). (Please reply to me - not the person whose account I used to post this) (B.t.w., I posted a ps(1) for MINIX 1.5 a week ago. Did anyone receive it out there? Please drop me a letter if you had any particular problems installing it, or if you didn't see it but would like to have it. I will repost it if necessary). -----cut here----- -----cut here----- -----cut here----- -----cut here----- #!bin/sh echo x - curses.c.cdiff sed '/^X/s///' > curses.c.cdiff << '/' X*** curses.c.old Sat Feb 3 00:45:50 1990 X--- curses.c Sat Feb 3 00:52:08 1990 X*************** X*** 25,30 **** X--- 25,32 ---- X extern char *malloc(); X extern char *getenv(); X X+ extern trapint(); X+ X /* variables, publicly available & used in the macros */ X short ospeed; /* speed of the tty, eg B2400 */ X WINDOW *stdscr; /* pointer into kbuf[] */ X*************** X*** 147,152 **** X--- 149,156 ---- X X if (quietly) return; X X+ signal(SIGINT, SIG_IGN); /* don't want intrs now */ X+ X /* Wait for a key from the user */ X for (dest = kbuf, src = tgoto(CM, 0, LINES - 1); *src; ) X *dest++ = *src++; X*************** X*** 165,170 **** X--- 169,176 ---- X { X ungetkey(':'); X } X+ X+ signal(SIGINT, trapint); /* resume intr catching */ X } X X static lacking(s) / echo x - move1.c.cdiff sed '/^X/s///' > move1.c.cdiff << '/' X*** move1.c.old Sun Feb 11 12:52:19 1990 X--- move1.c Sun Feb 11 12:57:04 1990 X*************** X*** 16,22 **** X #include "vi.h" X X #ifndef isascii X! # define isascii(c) !((c) & 0x7f) X #endif X X MARK moveup(m, cnt) X--- 16,22 ---- X #include "vi.h" X X #ifndef isascii X! # define isascii(c) !((c) & ~0x7f) X #endif X X MARK moveup(m, cnt) / echo x - system.c.cdiff sed '/^X/s///' > system.c.cdiff << '/' X*** system.c.old Fri Feb 2 23:37:24 1990 X--- system.c Sat Feb 3 01:00:00 1990 X*************** X*** 22,27 **** X--- 22,29 ---- X */ X X #include "vi.h" X+ #include X+ extern trapint(); X extern char **environ; X X X*************** X*** 44,50 **** X exit(1); /* if we get here, the exec failed */ X X default: /* parent */ X! wait(&status); X } X X return status; X--- 46,54 ---- X exit(1); /* if we get here, the exec failed */ X X default: /* parent */ X! signal(SIGINT, SIG_IGN); /* we don't want intr here */ X! wait(&status); X! signal(SIGINT, trapint); /* restore intr catching */ X } X X return status; X*************** X*** 95,100 **** X--- 99,105 ---- X exit(1); /* if we get here, exec failed */ X X default: /* parent */ X+ signal(SIGINT, SIG_IGN); /* reset after wait */ X /* close the "write" end of the pipe */ X close(r0w1[1]); X X*************** X*** 110,115 **** X--- 115,121 ---- X X close(fd); X wait(&status); X+ signal(SIGINT, trapint); /* restore intr catching */ X return status; X } X /