From 5c5fb404b1c87d80aa46614e56c5a13f0eb24044 Mon Sep 17 00:00:00 2001 From: tg Date: Fri, 20 Mar 2015 21:01:41 +0000 Subject: [PATCH] =?UTF-8?q?fix=20=E2=80=9Cread=20-n-1=E2=80=9D,=20which=20?= =?UTF-8?q?still=20returns=20once=20the=20first=20read()=20succeeds=20(it?= =?UTF-8?q?=E2=80=99s=20not=20identical=20to=20=E2=80=9Cread=20-N-1?= =?UTF-8?q?=E2=80=9D!)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- funcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/funcs.c b/funcs.c index 7e10ce6..71a02b2 100644 --- a/funcs.c +++ b/funcs.c @@ -38,7 +38,7 @@ #endif #endif -__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.265 2015/03/08 21:30:20 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.266 2015/03/20 21:01:41 tg Exp $"); #if HAVE_KILLPG /* @@ -1859,7 +1859,7 @@ c_read(const char **wp) if (!bi_getn(builtin_opt.optarg, &c)) return (2); if (c == -1) { - readmode = READALL; + readmode = readmode == BYTES ? READALL : UPTO; bytesleft = 1024; } else bytesleft = (unsigned int)c;