From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 19F953858D1E; Sat, 5 Mar 2022 01:06:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19F953858D1E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pty: Adopt the variable name to the name generally used. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: 6c622490a5004b06b8d714c7fbb73b2caa4fee7a X-Git-Newrev: 7c87cce6e2fe67584c20da1d4f7c5e4f19940250 Message-Id: <20220305010601.19F953858D1E@sourceware.org> Date: Sat, 5 Mar 2022 01:06:01 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Mar 2022 01:06:01 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D7c87cce6e2f= e67584c20da1d4f7c5e4f19940250 commit 7c87cce6e2fe67584c20da1d4f7c5e4f19940250 Author: Takashi Yano Date: Sat Mar 5 09:39:26 2022 +0900 Cygwin: pty: Adopt the variable name to the name generally used. =20 - Generally, '\n' is called "line feed" (not "new line"), so the variable name p_nl has been changed to p_lf. Diff: --- winsup/cygwin/fhandler_tty.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index c2e612580..e29b93ceb 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -580,20 +580,20 @@ fhandler_pty_master::accept_input () /* Write line by line for transfer input. */ char *p0 =3D p; char *p_cr =3D (char *) memchr (p0, '\r', bytes_left - (p0 - p)); - char *p_nl =3D (char *) memchr (p0, '\n', bytes_left - (p0 - p)); + char *p_lf =3D (char *) memchr (p0, '\n', bytes_left - (p0 - p)); DWORD n; - while (p_cr || p_nl) + while (p_cr || p_lf) { char *p1 =3D - p_cr ? (p_nl ? ((p_cr + 1 =3D=3D p_nl) - ? p_nl : min(p_cr, p_nl)) : p_cr) : p_nl; + p_cr ? (p_lf ? ((p_cr + 1 =3D=3D p_lf) + ? p_lf : min(p_cr, p_lf)) : p_cr) : p_lf; n =3D p1 - p0 + 1; rc =3D WriteFile (write_to, p0, n, &n, NULL); if (rc) written +=3D n; p0 =3D p1 + 1; p_cr =3D (char *) memchr (p0, '\r', bytes_left - (p0 - p)); - p_nl =3D (char *) memchr (p0, '\n', bytes_left - (p0 - p)); + p_lf =3D (char *) memchr (p0, '\n', bytes_left - (p0 - p)); } if (rc && (n =3D bytes_left - (p0 - p))) { @@ -3920,19 +3920,19 @@ fhandler_pty_slave::transfer_input (tty::xfer_dir d= ir, HANDLE from, tty *ttyp, /* Call WriteFile() line by line */ char *p0 =3D ptr; char *p_cr =3D (char *) memchr (p0, '\r', len - (p0 - ptr)); - char *p_nl =3D (char *) memchr (p0, '\n', len - (p0 - ptr)); - while (p_cr || p_nl) + char *p_lf =3D (char *) memchr (p0, '\n', len - (p0 - ptr)); + while (p_cr || p_lf) { char *p1 =3D - p_cr ? (p_nl ? ((p_cr + 1 =3D=3D p_nl) - ? p_nl : min(p_cr, p_nl)) : p_cr) : p_nl; + p_cr ? (p_lf ? ((p_cr + 1 =3D=3D p_lf) + ? p_lf : min(p_cr, p_lf)) : p_cr) : p_lf; *p1 =3D '\n'; n =3D p1 - p0 + 1; if (n && WriteFile (to, p0, n, &n, NULL) && n) transfered =3D true; p0 =3D p1 + 1; p_cr =3D (char *) memchr (p0, '\r', len - (p0 - ptr)); - p_nl =3D (char *) memchr (p0, '\n', len - (p0 - ptr)); + p_lf =3D (char *) memchr (p0, '\n', len - (p0 - ptr)); } n =3D len - (p0 - ptr); if (n && WriteFile (to, p0, n, &n, NULL) && n)