allow ^Cing the built-in cat, spotted by Johannes (jal) in IRC

This commit is contained in:
tg 2011-07-05 19:56:24 +00:00
parent 02b76603f8
commit 71fa2ca232
1 changed files with 5 additions and 2 deletions

View File

@ -38,7 +38,7 @@
#endif
#endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.191 2011/07/02 17:57:23 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.192 2011/07/05 19:56:24 tg Exp $");
#if HAVE_KILLPG
/*
@ -3596,9 +3596,12 @@ c_cat(const char **wp)
while (/* CONSTCOND */ 1) {
n = blocking_read(fd, (cp = buf), MKSH_CAT_BUFSIZ);
if (n == -1) {
if (errno == EINTR)
if (errno == EINTR) {
/* give the user a chance to ^C out */
intrcheck();
/* interrupted, try again */
continue;
}
/* an error occured during reading */
rv = errno;
bi_errorf("%s: %s", fn, strerror(rv));