This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
[Patch] fhandler.cc (pust_readahead): end-condition off.
- From: Bas van Gompel <cygwin-patches dot buzz at bavag dot tmfweb dot nl>
- To: cygwin-patches at cygwin dot com
- Date: Mon, 6 Dec 2004 02:45:10 +0100 (MET)
- Subject: [Patch] fhandler.cc (pust_readahead): end-condition off.
- Organisation: Ehm...
- Reply-to: cygwin-patches mailing-list <cygwin-patches at cygwin dot com>
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