SCCS-vsn: usr.bin/ex/ex_v.c 7.4
SCCS-vsn: usr.bin/ex/ex_vget.c 6.5
/* Copyright (c) 1981 Regents of the University of California */
/* Copyright (c) 1981 Regents of the University of California */
-static char *sccsid = "@(#)ex_v.c 7.3 %G%";
+static char *sccsid = "@(#)ex_v.c 7.4 %G%";
#include "ex.h"
#include "ex_re.h"
#include "ex_tty.h"
#include "ex.h"
#include "ex_re.h"
#include "ex_tty.h"
vintr()
{
extern jmp_buf readbuf;
vintr()
{
extern jmp_buf readbuf;
signal(SIGINT, vintr);
if (vcatch)
onintr();
ungetkey(ATTN);
draino();
signal(SIGINT, vintr);
if (vcatch)
onintr();
ungetkey(ATTN);
draino();
+ if (doingread) {
+ doingread = 0;
+ longjmp(readbuf, 1);
+ }
/* 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.4 %G%";
+static char *sccsid = "@(#)ex_vget.c 6.5 %G%";
#include "ex.h"
#include "ex_tty.h"
#include "ex_vis.h"
#include "ex.h"
#include "ex_tty.h"
#include "ex_vis.h"
short precbksl;
jmp_buf readbuf;
short precbksl;
jmp_buf readbuf;
/*
* Get a keystroke, including a ^@.
/*
* Get a keystroke, including a ^@.
again:
if (setjmp(readbuf))
goto getATTN;
again:
if (setjmp(readbuf))
goto getATTN;
- if ((c=read(slevel == 0 ? 0 : ttyindes, &ch, 1)) != 1) {
+ doingread = 1;
+ c = read(slevel == 0 ? 0 : ttyindes, &ch, 1);
+ doingread = 0;
+ if (c != 1) {
if (errno == EINTR)
goto getATTN;
error("Input read error");
if (errno == EINTR)
goto getATTN;
error("Input read error");