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

View File

@ -38,7 +38,7 @@
#endif #endif
#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 #if HAVE_KILLPG
/* /*
@ -3596,9 +3596,12 @@ c_cat(const char **wp)
while (/* CONSTCOND */ 1) { while (/* CONSTCOND */ 1) {
n = blocking_read(fd, (cp = buf), MKSH_CAT_BUFSIZ); n = blocking_read(fd, (cp = buf), MKSH_CAT_BUFSIZ);
if (n == -1) { if (n == -1) {
if (errno == EINTR) if (errno == EINTR) {
/* give the user a chance to ^C out */
intrcheck();
/* interrupted, try again */ /* interrupted, try again */
continue; continue;
}
/* an error occured during reading */ /* an error occured during reading */
rv = errno; rv = errno;
bi_errorf("%s: %s", fn, strerror(rv)); bi_errorf("%s: %s", fn, strerror(rv));