Regression found by deraadt@
-/* $OpenBSD: file.c,v 1.26 2017/06/21 19:36:23 anton Exp $ */
+/* $OpenBSD: file.c,v 1.27 2017/06/22 18:05:31 anton Exp $ */
/* $NetBSD: file.c,v 1.11 1996/11/08 19:34:37 christos Exp $ */
/*-
cl_abort(struct cmdline *cl, int c)
{
cl_visc(cl, c);
+
+ /* Abort while/foreach loop prematurely. */
+ if (whyles)
+ kill(getpid(), SIGINT);
+
cl_putc(cl, '\n');
cl->len = cl->cursor = 0;
cl->flags |= CL_PROMPT;
# VINTR: Abort line.
testseq "\0003" " % ^C\r\n % "
testseq "ab\0003" " % ab^C\r\n % "
+testseq "foreach i ()\n\0003a" " % foreach i ()\r\n? ^C\r\r\n % a"
# VKILL: Kill line.
testseq "\0025" " % "