[Patch] fhandler.cc (pust_readahead): end-condition off.
Bas van Gompel
cygwin-patches.buzz@bavag.tmfweb.nl
Mon Dec 6 01:45:00 GMT 2004
Hi,
A real bugfix this time.
When fhandler_base::puts_readahead is given a (non -1) len-parameter,
in the current implementation, not len characters are stowed, but len
z-strings. This affects at least fhandler_pty_master::accept_input in
fhandler_tty.cc.
Following (trivial, I'd say) patch ought to fix it.
ChangeLog-entry:
2004-12-06 Bas van Gompel <cygwin-patch@bavag.tmfweb.nl>
* fhandler.cc (fhandler_base::puts_readahead): Fix end-condition.
--- src/winsup/cygwin-mmod/fhandler.cc 5 Dec 2004 07:28:27 -0000 1.209
+++ src/winsup/cygwin-mmod/fhandler.cc 6 Dec 2004 01:14:14 -0000
@@ -54,7 +54,7 @@ int
fhandler_base::puts_readahead (const char *s, size_t len)
{
int success = 1;
- while ((*s || (len != (size_t) -1 && len--))
+ while ((len == (size_t) -1 ? *s : len--)
&& (success = put_readahead (*s++) > 0))
continue;
return success;
L8r,
Buzz.
--
) | | ---/ ---/ Yes, this | This message consists of true | I do not
-- | | / / really is | and false bits entirely. | mail for
) | | / / a 72 by 4 +-------------------------------+ any1 but
-- \--| /--- /--- .sigfile. | |perl -pe "s.u(z)\1.as." | me. 4^re
More information about the Cygwin-patches
mailing list