fix “read -n-1”, which still returns once the first read() succeeds
(it’s not identical to “read -N-1”!)
This commit is contained in:
parent
0d72355038
commit
5c5fb404b1
4
funcs.c
4
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user