[PATCH] Cygwin: pty: Remove meaningless pointer increment.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Cygwin: pty: Remove meaningless pointer increment.

Takashi Yano
- Since commit 73742508fcd8e994450582c1b7296c709da66764, a pointer
  increment in master write code which has no effect was remaining.
---
 winsup/cygwin/fhandler_tty.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index c1c0fb812..1dd57b369 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -2338,7 +2338,7 @@ fhandler_pty_master::write (const void *ptr, size_t len)
       WriteFile (to_slave, "\003", 1, &n, 0);
     }
 
-  line_edit_status status = line_edit (p++, len, ti, &ret);
+  line_edit_status status = line_edit (p, len, ti, &ret);
   if (status > line_edit_signalled && status != line_edit_pipe_full)
     ret = -1;
   return ret;
--
2.21.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Cygwin: pty: Remove meaningless pointer increment.

Corinna Vinschen-2
On Feb  4 21:25, Takashi Yano wrote:

> - Since commit 73742508fcd8e994450582c1b7296c709da66764, a pointer
>   increment in master write code which has no effect was remaining.
> ---
>  winsup/cygwin/fhandler_tty.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
> index c1c0fb812..1dd57b369 100644
> --- a/winsup/cygwin/fhandler_tty.cc
> +++ b/winsup/cygwin/fhandler_tty.cc
> @@ -2338,7 +2338,7 @@ fhandler_pty_master::write (const void *ptr, size_t len)
>        WriteFile (to_slave, "\003", 1, &n, 0);
>      }
>  
> -  line_edit_status status = line_edit (p++, len, ti, &ret);
> +  line_edit_status status = line_edit (p, len, ti, &ret);
>    if (status > line_edit_signalled && status != line_edit_pipe_full)
>      ret = -1;
>    return ret;
> --
> 2.21.0

Pushed.

Thanks,
Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment