From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 910F73858C51; Wed, 3 Aug 2022 04:41:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 910F73858C51 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: path: Make some symlinks to /cygdrive/* work. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: bfee9c6ab0c3c9a5742e84509d01ec6472aa62c4 X-Git-Newrev: 8b502d863500149f4e86497714f0462e788f2f1e Message-Id: <20220803044135.910F73858C51@sourceware.org> Date: Wed, 3 Aug 2022 04:41:35 +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: Wed, 03 Aug 2022 04:41:35 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D8b502d86350= 0149f4e86497714f0462e788f2f1e commit 8b502d863500149f4e86497714f0462e788f2f1e Author: Takashi Yano Date: Mon Aug 1 09:02:23 2022 +0900 Cygwin: path: Make some symlinks to /cygdrive/* work. =20 - Previously, some symbolic links to /cygdrive/* (e.g. /cygdrive/C, /cygdrive/./c, /cygdrive//c, etc.) did not work. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin/2022-July/251994.html Diff: --- winsup/cygwin/path.cc | 6 +++++- winsup/cygwin/release/3.3.6 | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index ea695ed99..b159b56d0 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1929,7 +1929,11 @@ symlink_wsl (const char *oldpath, path_conv &win32_n= ewpath) cygdrive prefix is not "/", otherwise suffer random "/mnt" symlinks..= . */ if (mount_table->cygdrive_len > 1 && path_prefix_p (mount_table->cygdrive, oldpath, - mount_table->cygdrive_len, false)) + mount_table->cygdrive_len, false) + && (strlen (oldpath + mount_table->cygdrive_len - 1) < 2 + || (islower (oldpath[mount_table->cygdrive_len]) + && (oldpath[mount_table->cygdrive_len + 1] =3D=3D '/' + || oldpath[mount_table->cygdrive_len + 1] =3D=3D '\0')))) stpcpy (stpcpy (path_buf, "/mnt"), oldpath + mount_table->cygdrive_len - 1); else diff --git a/winsup/cygwin/release/3.3.6 b/winsup/cygwin/release/3.3.6 index 5fb59bf7d..078e6e520 100644 --- a/winsup/cygwin/release/3.3.6 +++ b/winsup/cygwin/release/3.3.6 @@ -31,3 +31,7 @@ Bug Fixes native apps if *.bat or *.cmd is executed directly from cygwin shell. Addresses: https://cygwin.com/pipermail/cygwin/2022-July/251993.html + +- Fix a problem that prevented some symbolic links to /cygdrive/C, + /cygdrive/./c, /cygdrive//c, etc. from working. + Addresses: https://cygwin.com/pipermail/cygwin/2022-July/251994.html