X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=OClDWBEE5E715rs4Z6TbS6VwhNYZeK1nwmiDocyxLKfc92PaRGGCH
	d+ha5Xbxh6ZiEhO7JhyLiHucF/lymvkxzK9NaN0djlOHPOBawlECGvQ4W6LU6Pqf
	Z3NLEYiImDWfGRCu04afTU2csDZhq8RxwPo0ldDGhIt+hGDYhQiyWc=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=cmI68JxGkoGhFod2hOMO2wGMma0=; b=XpVhG28RIejHs9QNAR6xfiEANZsa
	dDb5p90lpZPkif27cYhFLRJEz/QeGcnFR9CKCwOyMAc3tpgS9Ae/n4Qtav3R51TW
	zWKMmwVymAMTn0NTpX/EDC/wIhwq+GcfRSYT/lsfSQVEhjINLfb9aN37aDI8PwpH
	0z2hc+V0vcCStOw=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-101.6 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1327, backslashes, Naturally, ntfs
X-HELO: drew.franken.de
Date: Sun, 12 Feb 2017 12:23:14 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: cygpath -w converts relative paths to absolute windows paths
Message-ID: <20170212112314.GE11666@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <10eb657d-a00b-1609-a9b9-6373092c1ac1@polyhack.io>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;	protocol="application/pgp-signature"; boundary="GZVR6ND4mMseVXL/"
Content-Disposition: inline
In-Reply-To: <10eb657d-a00b-1609-a9b9-6373092c1ac1@polyhack.io>
User-Agent: Mutt/1.7.1 (2016-10-04)

--GZVR6ND4mMseVXL/
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Feb  7 14:35, Roger Qiu wrote:
> Hi,
>=20
> I've found that `cygpath --windows '../` will give back an absolute windo=
ws
> path.
>=20
> I thought this would only happen if you provide the `--absolute` flag, or
> when the path is a special cygwin path.
>=20
> But this occurs just for normal directories.
>=20
> I have come across a situation where I need to convert ntfs symlinks to u=
nix
> symlinks and back. Sometimes these symlinks have relative paths them. Now=
 by
> using cygpath --windows, I get back absolute paths, which means the
> integrity of the symlink isn't preserved.
>=20
> Can `cygpath --windows '../directory'` give back `..\directory` for paths
> aren't special cygwin paths? These relative backslashes are supported in
> Windows right now.

Not easily.  All paths are evaluated as absolute paths inside Cygwin.
The result of the path conversion is always an absolute path. A relative
path is generated from there by checking if the path prefix in POSIX
notation is identical to the current working directory.  If not, the
path stays absolute.  Naturally, if you use a "..", the resulting path
does not match the CWD anymore, so you're out.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--GZVR6ND4mMseVXL/
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJYoEWiAAoJEPU2Bp2uRE+gHucP+wRI1Ud2JJE/V29oOytrryHm
C7mC002/n0n8oIzbu/9pJPwPuXvAHDokmNpTaO6n+ThAmLoTIka74q+OKOkdoiy3
IuLrlce3Kc2+JGIyCUQ7dCef0AmJq9yye0v3t4xqhi/zkJwMiQ+y1W5jmUiYpbIj
Be88DrgW6S5/55+e58fDgphYffnJ4HwKPv2v2hLkc/5GCB6IJI1BZVK71wH9bp78
RX1jYy17FGRP+D6HGMSzd5s+/iBudj3Yzys4kA5yCpS/jJhHQ2agUX7/vRqkDFSS
cBKpBpX/S9k7llRoq2ZqYA/bLP2JQmnz0a8QO7hTFJEpaTHnBQJK4igoANvI4rdA
3TVyV7l74EuSILhMr4rH1pUQ5Wj9gbtjZHIolsVffzVZ2X0UaKJwtbX1IxamtAPu
KyStvmcLy87qPvRzNUzoNro83T7xf8+b/Izswo8aDkzKefNVnJhcGr7llxl6t0kI
x+NoMD0+1T3Ucxkf9fjE8OjkT9bCP+0pcHNktHAjiG5KfRA7aw/pJVpfglBqLvlI
8RQv/mEoTMX/ZLbeU8CL1334UoobayhvR1ENGyAc22wx+rLXnriJctUlnqPzEl1m
4rqa9519ymgHku/61iPH0G3jV6/knpj4vY2VWS0Y2EppFzGp6+ZLnfx7fltYOgdq
ogtQRo1qPwVaHJ3Vl6HF
=/5Mw
-----END PGP SIGNATURE-----

--GZVR6ND4mMseVXL/--
