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:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 q=dns; s=default; b=kCWyflN87HPOHWVw74uz9uhZ+xxQqgMpW2TdhbC9YIP
	Okc3hKtijnZW2n8Z9/ceYNsuPM5jb5cMFLhjt48uV4zfRfouvYHKqwwzFUF3DR6a
	Wb8OHXJi77FBhcnb6KKPqhRg4W4SBx//VrROWLeuFv9dfViSh77ZburN4Ocl6Ggs
	=
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:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 s=default; bh=HAQpL7C5LcFlbGtdC60PuB39WJo=; b=XHZxAygqtS7fSsptS
	bwBepmJlKYGr4Ovk36g2Br/L92Ibr8Zi5nqk7TrsJnC6yb8eTS5AewcHmvXjDLAD
	YLzpPzDVz9GVqPQBUEH+lSEAT8IzOpbIpzNHxyU/d4txwfBEL5uljDZZBTFc9HBW
	NL3QGLwqZn0gORUEjw14jK+/TE=
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=0.2 required=5.0 tests=AWL,BAYES_00,HELO_MISC_IP,KHOP_DYNAMIC,KHOP_THREADED,RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC,TVD_RCVD_IP autolearn=no version=3.3.2
X-HELO: konqorde.nl
Message-ID: <5239E0D8.7080703@mailme.ath.cx>
Date: Wed, 18 Sep 2013 19:20:24 +0200
From: bartels <bartels@mailme.ath.cx>
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130704 Icedove/17.0.7
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: cygpath -m behaviour change
References: <CAF+hkWpba76MxiLzbcfUD=bHs=N=Xbti7vN4qLw7H2BWtWYQYw@mail.gmail.com>
In-Reply-To: <CAF+hkWpba76MxiLzbcfUD=bHs=N=Xbti7vN4qLw7H2BWtWYQYw@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

On 09/18/2013 04:34 PM, David Griffiths wrote:
> Hi, the script is attempting to determine the directory in which it
> exists, so CURRENT_DIR is a bit misleading. This is so that it can
> access other files in the same package relative to it (quite a common
> technique I think).
>
> Might be helpful to have some examples:
>
> /home/dgriff> mkdir test
> /home/dgriff> cd test
> /home/dgriff/test> cygpath -m "file\.."
> ./
> /home/dgriff/test> cygpath -m "file/.."
> cygpath: error converting "file/.." - No such file or directory
> /home/dgriff/test> cygpath -m "file\..\.."
> C:/cygwin/home/dgriff/
> /home/dgriff/test> cygpath -m "file/../.."
> cygpath: error converting "file/../.." - No such file or directory
> /home/dgriff/test> touch file
> /home/dgriff/test> cygpath -m "file/../.."
> cygpath: error converting "file/../.." - No such file or directory
> /home/dgriff/test> cygpath -m "file\..\.."
> C:/cygwin/home/dgriff/
> /home/dgriff/test> mkdir dir
> /home/dgriff/test> cygpath -m "dir/../.."
> C:/cygwin/home/dgriff/
>
> Note that the backslash variant always works and all of these used to
> work under previous levels of cygwin.

Conceptually, I have always considered relative paths to be relative to a directory.
Your one liners are creating a path relative to a file.

I think that approach is flawed and there is nothing wrong in the way cygpath works now.
Yesterday's cygpath behaviour was probably not intentional.

We have utilities like dirname and realpath available to help out.

Just my  thoughts . . .

- Bartels


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

