From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93964 invoked by alias); 8 Feb 2016 18:13:10 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 93951 invoked by uid 89); 8 Feb 2016 18:13:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-93.9 required=5.0 tests=BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_PBL,RDNS_DYNAMIC,USER_IN_WHITELIST autolearn=no version=3.3.2 spammy=exposure, WIN, H*R:D*cygwin.com, sk:ccp_win X-HELO: calimero.vinschen.de Received: from ipbcc0d020.dynamic.kabel-deutschland.de (HELO calimero.vinschen.de) (188.192.208.32) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 Feb 2016 18:13:09 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 77024A804DF; Mon, 8 Feb 2016 19:13:06 +0100 (CET) Date: Mon, 08 Feb 2016 18:13:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: cygwin_conv_path sometimes removes trailing slash Message-ID: <20160208181306.GH12975@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <56AC2C35.9060903@cornell.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qM81t570OJUP5TU/" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SW-Source: 2016-02/txt/msg00085.txt.bz2 --qM81t570OJUP5TU/ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2263 Hi Ray, On Jan 31 22:17, Ray Donnelly wrote: > On Sun, Jan 31, 2016 at 11:38 AM, Jan Nijtmans w= rote: > > 2016-01-30 4:21 GMT+01:00 Ken Brown: > >> I'm using cygwin_conv_path to convert Win32 paths to POSIX paths, and = I'm > >> puzzled by the conversion > >> > >> d:/ --> /cygdrive/d > >> > >> without the trailing slash. By contrast, we have > >> > >> d:/foo/ --> /cygdrive/d/foo/ > > > > This came up before: > > > > I had to workaround it in tkimg. > > > > It's easy to workaround in your program, but - indeed - > > that shouldn't be necessary. I too would expect that > > when the input contains a slash, the output should too. > > >=20 > I've attached the patch that we use on MSYS2 for this. We found > ourselves patching projects all over the open-source landscape > otherwise How many projects require exposure to the conversion from POSIX to Win32 paths? This is something which should be used in applications only very rarely. Usually they just feed the POSIX path into functions like open, etc., and that's it. > so fixing it once and for all seems sensible. Note however, > a full fix also requires another patch that I posted two years ago [1] > that Corinna chose not to apply. In the two years since, we've yet to > find any issue with that patch. I will rebase it shortly in-case > there's any interest in reconsidering it. >=20 > [1] https://cygwin.com/ml/cygwin-patches/2014-q1/msg00010.html Your patches don't work for Ken's case since path_conv::check is never called for CCP_WIN_A_TO_POSIX/CCP_WIN_W_TO_POSIX conversion. I have a patch in the loop to fix that. I'm not quite sure what your first patch is supposed to accomplish in the POSIX->WIN case. tail =3D=3D path_copy + 1 means the incoming path is "/". Your patch will result in changing the conversion of=20 / --> C:\cygwin to / --> C:\cygwin\ Is that really desired? What especially bugs me is that this occurs in the very core of the path conversion which isn't only used in places exposed to user space. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --qM81t570OJUP5TU/ Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWuNqyAAoJEPU2Bp2uRE+gRBQP/AzacDS3nGxyj7JGhHT2pwU0 H5lufp+/RLT1lowPO+cA4QcNuWrpFDimuXsr9084gEKxZiUTJ8ODIhSei9fivOYc IGYsfv1qlvJuOYuGr7Gh4psUggM5H4/51mzkutohbUmk3HTAy1O/mNxhRYEI1zsh QCuA05NAuV2hH5Jjdo+7XUVjSU9QG8booY8AxHPx55ahde+isuYtoVULIuhenJUi 3JsR9m1tVpeyA/1LgqlLTvk2n57n0+JQyZdtG81KfT/S5/oRB1fD6pwcwFYOkqUa cCPCPf4vkQus2GE0HM3rxt/d68ZzP1tLmewR1PpSYxEdFgDQQghjFmZH1T0wHVfR fkSSCLP/5gYhNDYTHJN5GXF/ptuyGmCPLNkF/1IeLZuRYbcV5avd4S9Ukz3lqsxX L7Tlv6+mEuO6kADs1b+0DJA0DkeW750A0CIgyVH/z6lGLGd4UIi3C9JZd18jTndC 9+8VkrPSvUxpXPSGsA4/Q96TrbxYZqOFkMKTe9fTEru9e7CoPOF7kyjeJIWft0Lh mdQIQVNoPMJCAMg9yWThqfRmodxSOeG4JnecLeajMDv72iI4ckkkeoywi9pUDlHv XHDKOwFtrKrB7PKaOpURFaQDfnG9LRBQ470Z3mEfArqiLzA40xSVJyBVPEEwXcRW zxz05oQkT8Z0Qi2GQb60 =9U5Y -----END PGP SIGNATURE----- --qM81t570OJUP5TU/--