=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/signal.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.3 diff -u -r1.1.1.2 -r1.1.1.3 --- src/usr.bin/less/signal.c 2003/04/13 18:21:21 1.1.1.2 +++ src/usr.bin/less/signal.c 2011/09/16 17:47:08 1.1.1.3 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2002 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -33,6 +33,8 @@ extern int linenums; extern int wscroll; extern int reading; +extern int quit_on_intr; +extern long jump_sline_fraction; /* * Interrupt signal handler. @@ -42,6 +44,7 @@ u_interrupt(type) int type; { + bell(); #if OS2 LSIGNAL(SIGINT, SIG_ACK); #endif @@ -57,7 +60,7 @@ getkey(); #endif if (reading) - intread(); + intread(); /* May longjmp */ } #ifdef SIGTSTP @@ -152,14 +155,13 @@ #endif #ifdef SIGWINCH (void) LSIGNAL(SIGWINCH, winch); -#else +#endif #ifdef SIGWIND (void) LSIGNAL(SIGWIND, winch); #endif #ifdef SIGQUIT (void) LSIGNAL(SIGQUIT, SIG_IGN); #endif -#endif } else { /* @@ -241,30 +243,15 @@ if (sc_width != old_width || sc_height != old_height) { wscroll = (sc_height + 1) / 2; + calc_jump_sline(); + calc_shift_count(); screen_trashed = 1; } } #endif if (tsignals & S_INTERRUPT) { - bell(); - /* - * {{ You may wish to replace the bell() with - * error("Interrupt", NULL_PARG); }} - */ - - /* - * If we were interrupted while in the "calculating - * line numbers" loop, turn off line numbers. - */ - if (lnloop) - { - lnloop = 0; - if (linenums == 2) - screen_trashed = 1; - linenums = 0; - error("Line numbers turned off", NULL_PARG); - } - + if (quit_on_intr) + quit(QUIT_INTERRUPT); } }