don't replace current line if ESC ^C is typed.
authorRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Thu, 24 Jan 1985 06:23:47 +0000 (22:23 -0800)
committerRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Thu, 24 Jan 1985 06:23:47 +0000 (22:23 -0800)
SCCS-vsn: usr.bin/ex/ex_vget.c 6.6

usr/src/usr.bin/ex/ex_vget.c

index a1c28d3..4d3cc42 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-static char *sccsid = "@(#)ex_vget.c   6.5 %G%";
+static char *sccsid = "@(#)ex_vget.c   6.6 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
@@ -628,6 +628,7 @@ vgetcnt()
 fastpeekkey()
 {
        int trapalarm();
 fastpeekkey()
 {
        int trapalarm();
+       int (*Oint)();
        register int c;
 
        /*
        register int c;
 
        /*
@@ -645,6 +646,7 @@ fastpeekkey()
        if (trace)
                fprintf(trace,"\nfastpeekkey: ",c);
 #endif
        if (trace)
                fprintf(trace,"\nfastpeekkey: ",c);
 #endif
+       Oint = signal(SIGINT, trapalarm);
        if (value(TIMEOUT) && inopen >= 0) {
                signal(SIGALRM, trapalarm);
 #ifdef MDEBUG
        if (value(TIMEOUT) && inopen >= 0) {
                signal(SIGALRM, trapalarm);
 #ifdef MDEBUG
@@ -673,10 +675,12 @@ fastpeekkey()
        if (trace)
                fprintf(trace,"[fpk:%o]",c);
 #endif
        if (trace)
                fprintf(trace,"[fpk:%o]",c);
 #endif
+       signal(SIGINT,Oint);
        return(c);
 }
 
 trapalarm() {
        alarm(0);
        return(c);
 }
 
 trapalarm() {
        alarm(0);
-       longjmp(vreslab,1);
+       if (vcatch)
+               longjmp(vreslab,1);
 }
 }