=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/msgs/Attic/msgs.c,v retrieving revision 1.32 retrieving revision 1.33 diff -c -r1.32 -r1.33 *** src/usr.bin/msgs/Attic/msgs.c 2007/09/09 12:36:38 1.32 --- src/usr.bin/msgs/Attic/msgs.c 2007/09/11 18:22:42 1.33 *************** *** 1,4 **** ! /* $OpenBSD: msgs.c,v 1.32 2007/09/09 12:36:38 chl Exp $ */ /* $NetBSD: msgs.c,v 1.7 1995/09/28 06:57:40 tls Exp $ */ /*- --- 1,4 ---- ! /* $OpenBSD: msgs.c,v 1.33 2007/09/11 18:22:42 cloder Exp $ */ /* $NetBSD: msgs.c,v 1.7 1995/09/28 06:57:40 tls Exp $ */ /*- *************** *** 40,46 **** #if 0 static char sccsid[] = "@(#)msgs.c 8.2 (Berkeley) 4/28/95"; #else ! static char rcsid[] = "$OpenBSD: msgs.c,v 1.32 2007/09/09 12:36:38 chl Exp $"; #endif #endif /* not lint */ --- 40,46 ---- #if 0 static char sccsid[] = "@(#)msgs.c 8.2 (Berkeley) 4/28/95"; #else ! static char rcsid[] = "$OpenBSD: msgs.c,v 1.33 2007/09/11 18:22:42 cloder Exp $"; #endif #endif /* not lint */ *************** *** 127,133 **** bool mailing = NO; bool quitit = NO; bool sending = NO; - bool intrpflg = NO; bool restricted = NO; int uid; int msg; --- 127,132 ---- *************** *** 137,142 **** --- 136,142 ---- int Lpp = 0; time_t t; time_t keep; + volatile sig_atomic_t intrpflg = 0; void prmesg(int); void onintr(int); *************** *** 588,594 **** prevmsg = msg; } ! printf("--%s--\n", sep); sep = "-"; if (msg >= nextmsg) { nextmsg = msg + 1; --- 588,594 ---- prevmsg = msg; } ! printf("--%s--\n", (intrpflg ? "Interrupt" : sep)); sep = "-"; if (msg >= nextmsg) { nextmsg = msg + 1; *************** *** 689,698 **** write(STDOUT_FILENO, "\n", 1); if (hdrs) _exit(0); - sep = "Interrupt"; if (newmsg) fseeko(newmsg, (off_t)0, SEEK_END); ! intrpflg = YES; } errno = save_errno; } --- 689,697 ---- write(STDOUT_FILENO, "\n", 1); if (hdrs) _exit(0); if (newmsg) fseeko(newmsg, (off_t)0, SEEK_END); ! intrpflg = 1; } errno = save_errno; } *************** *** 752,758 **** printf("%s ", prompt); fflush(stdout); ! intrpflg = NO; if (fgets(inbuf, sizeof inbuf, stdin) == NULL) errx(1, "could not read input"); inbuf[strcspn(inbuf, "\n")] = '\0'; --- 751,757 ---- printf("%s ", prompt); fflush(stdout); ! intrpflg = 0; if (fgets(inbuf, sizeof inbuf, stdin) == NULL) errx(1, "could not read input"); inbuf[strcspn(inbuf, "\n")] = '\0';