This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: cygpath -m behaviour change
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 16 Sep 2013 11:12:29 -0400
- Subject: Re: cygpath -m behaviour change
- Authentication-results: sourceware.org; auth=none
- References: <CAF+hkWo0jXKKLM8pS8gZLG0rak+wcLpWJdS2He2_=MxYb0gpYw at mail dot gmail dot com>
- Reply-to: cygwin at cygwin dot com
On Mon, Sep 16, 2013 at 10:56:37AM +0100, David Griffiths wrote:
>> Yes, that's exactly right, assuming that 'boo' doesn't exist.
>
>Hi, it happens even if boo does exist.
Not for me.
% mkdir /boo
norton[~]
$ ls /boo/..
bin cygwin dev localhome proc usr
boo cygwin.bat etc netrel sbin var
cygdrive cygwin.ico home netrel.build share
cygmount.bat Cygwin-Terminal.ico lib netrel.inst tmp
norton[~]
% cygpath -m /boo/..
D:/cygwin
It doesn't work if boo is not a directory but that is as expected.
>To put it in context, the
>script in question was attempting to determine the current directory:
>
>CURRENT_DIR=$(cygpath -ma "${0}"/../)
>
>(I didn't write this script but I assume they did this for performance reasons.)
>But anyway, as you can see ${0} always exists.
>
>I looked at the other thread but don't see an immediate connection as
>that was checking for non-existing path members.
nonexistent or non-directory. We've fixed a bug in later versions of Cygwin
which this script relied on.
It could be rewritten as:
CURRENT_DIR=$(cygpath -ma "$(dirname $0)")
(assuming that CURRENT_DIR isn't really trying to find the cwd, in which
case the script is just wrong to begin with)
cgf
--
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