=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/signal.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/usr.bin/less/signal.c 2003/06/18 18:40:09 1.6 +++ src/usr.bin/less/signal.c 2011/09/16 18:12:09 1.7 @@ -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. @@ -30,6 +30,8 @@ extern int lnloop; extern int linenums; extern int wscroll; +extern int quit_on_intr; +extern long jump_sline_fraction; /* * Interrupt signal handler. @@ -39,6 +41,7 @@ u_interrupt(type) int type; { + bell(); #if OS2 LSIGNAL(SIGINT, SIG_ACK); #endif @@ -137,14 +140,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 { /* @@ -226,31 +228,16 @@ 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 == OPT_ONPLUS) - screen_trashed = 1; - linenums = 0; - error("Line numbers turned off", NULL_PARG); - } - + if (quit_on_intr) + quit(QUIT_INTERRUPT); } }