public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* cygpath -m behaviour change
@ 2013-09-13 17:14 David Griffiths
  2013-09-13 18:14 ` Robert Pendell
  0 siblings, 1 reply; 14+ messages in thread
From: David Griffiths @ 2013-09-13 17:14 UTC (permalink / raw)
  To: cygwin

I reinstalled cygwin after a disk failure recently and one of my
scripts stopped working. The problem can be easily reproduced by
entering:

    $ cygpath -m boo/..
    cygpath: error converting "boo/.." - No such file or directory

this is with version 1.7.24(0.269/5/3). On another machine with 1.7.17
installed, the same command results in "./".

I can workaround by using backslashes instead of forward slashes but
other people might find their scripts broken as well.

Cheers,

Dave

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
  2013-09-13 17:14 cygpath -m behaviour change David Griffiths
@ 2013-09-13 18:14 ` Robert Pendell
  2013-09-13 21:55   ` Christopher Faylor
  0 siblings, 1 reply; 14+ messages in thread
From: Robert Pendell @ 2013-09-13 18:14 UTC (permalink / raw)
  To: cygwin

On Fri, Sep 13, 2013 at 11:55 AM, David Griffiths <> wrote:
> I reinstalled cygwin after a disk failure recently and one of my
> scripts stopped working. The problem can be easily reproduced by
> entering:
>
>     $ cygpath -m boo/..
>     cygpath: error converting "boo/.." - No such file or directory
>
> this is with version 1.7.24(0.269/5/3). On another machine with 1.7.17
> installed, the same command results in "./".
>
> I can workaround by using backslashes instead of forward slashes but
> other people might find their scripts broken as well.
>
> Cheers,
>
> Dave
>

I believe this behavior was changed in 1.7.22

See this thread for more information but basically it was changed to
conform /.. path checking to posix standards.

http://cygwin.com/ml/cygwin/2013-05/msg00222.html

Robert Pendell
A perfect world is one of chaos.

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
  2013-09-13 18:14 ` Robert Pendell
@ 2013-09-13 21:55   ` Christopher Faylor
  0 siblings, 0 replies; 14+ messages in thread
From: Christopher Faylor @ 2013-09-13 21:55 UTC (permalink / raw)
  To: cygwin

On Fri, Sep 13, 2013 at 01:17:05PM -0400, Robert Pendell wrote:
>On Fri, Sep 13, 2013 at 11:55 AM, David Griffiths <> wrote:
>> I reinstalled cygwin after a disk failure recently and one of my
>> scripts stopped working. The problem can be easily reproduced by
>> entering:
>>
>>     $ cygpath -m boo/..
>>     cygpath: error converting "boo/.." - No such file or directory
>>
>> this is with version 1.7.24(0.269/5/3). On another machine with 1.7.17
>> installed, the same command results in "./".
>>
>> I can workaround by using backslashes instead of forward slashes but
>> other people might find their scripts broken as well.
>>
>> Cheers,
>>
>> Dave
>>
>
>I believe this behavior was changed in 1.7.22
>
>See this thread for more information but basically it was changed to
>conform /.. path checking to posix standards.
>
>http://cygwin.com/ml/cygwin/2013-05/msg00222.html

Yes, that's exactly right, assuming that 'boo' doesn't exist.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
  2013-09-19 14:36 David Griffiths
@ 2013-09-19 16:16 ` Robert Klemme
  0 siblings, 0 replies; 14+ messages in thread
From: Robert Klemme @ 2013-09-19 16:16 UTC (permalink / raw)
  To: cygwin

On Thu, Sep 19, 2013 at 3:23 PM, David Griffiths
<david.griffiths@gmail.com> wrote:
>> But why are you even using cygpath to try and determine the containing
>> directory?  'dirname' does that task, in a much more portable manner,
>> and without having to worry about whether 'file/..' can be abused in
>> spite of POSIX semantics
>
> To given even more context, this is how it was used:
>
> uname=`uname`
>
> case $uname in
>   CYGWIN_*)
>     CURRENT_DIR=$(cygpath -ma "${0}\..")
>     ;;
>
>   *)
>     CURRENT_DIR=$(cd $(dirname "$0") && pwd)
> esac
>
> CURRENT_DIR (or something derived from it) ends up getting passed to a
> Java program which requires the absolute pathname in native format.
> The dirname/pwd variant won't do that under cygwin.

I don't understand why there is a difference made with regard to the
directory extraction in Cygwin and others.  I'd probably rather have
done

CURRENT_DIR=$(dirname "$0")

if  [ ! -d "$CURRENT_DIR" ]; then
  echo "ERROR: cannot derive directory from script path: $0" >&2
  exit 1
fi

case $(uname) in
  CYGWIN_*)
    CURRENT_DIR=$(cygpath -wa "$CURRENT_DIR")
    ;;
  *)
    CURRENT_DIR=$(cd "$CURRENT_DIR" && pwd)
   ;;
esac

"$JAVA_HOME/bin/java" foo.bar.Main "$CURRENT_DIR"

Kind regards

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
@ 2013-09-19 14:36 David Griffiths
  2013-09-19 16:16 ` Robert Klemme
  0 siblings, 1 reply; 14+ messages in thread
From: David Griffiths @ 2013-09-19 14:36 UTC (permalink / raw)
  To: cygwin

> But why are you even using cygpath to try and determine the containing
> directory?  'dirname' does that task, in a much more portable manner,
> and without having to worry about whether 'file/..' can be abused in
> spite of POSIX semantics

To given even more context, this is how it was used:

uname=`uname`

case $uname in
  CYGWIN_*)
    CURRENT_DIR=$(cygpath -ma "${0}\..")
    ;;

  *)
    CURRENT_DIR=$(cd $(dirname "$0") && pwd)
esac

CURRENT_DIR (or something derived from it) ends up getting passed to a
Java program which requires the absolute pathname in native format.
The dirname/pwd variant won't do that under cygwin.

Cheers,

Dave

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
  2013-09-18 15:20 David Griffiths
  2013-09-18 15:26 ` Eric Blake
@ 2013-09-18 17:31 ` bartels
  1 sibling, 0 replies; 14+ messages in thread
From: bartels @ 2013-09-18 17:31 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
  2013-09-18 15:20 David Griffiths
@ 2013-09-18 15:26 ` Eric Blake
  2013-09-18 17:31 ` bartels
  1 sibling, 0 replies; 14+ messages in thread
From: Eric Blake @ 2013-09-18 15:26 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1685 bytes --]

On 09/18/2013 08:34 AM, 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\.."
> ./

Using \ means you are asking Windows to do the resolution, and Windows
has a known issue that it is intentionally NOT posix-compliant unless
you tweak a registry option.  But the fact that you can tweak a registry
option means that you CAN encounter machines where file\.. will fail to
resolve instead of (incorrectly optimizing) to . without first checking
whether "file/" is a directory.

> /home/dgriff/test> cygpath -m "file/.."
> cygpath: error converting "file/.." - No such file or directory

This is POSIX-mandated behavior, and since you used /, you asked for
POSIX semantics.  This is not a bug.

> 
> Note that the backslash variant always works and all of these used to
> work under previous levels of cygwin.

The backslash variants "work" only so far as the windows registry
setting has not been tweaked to allow windows to use its non-posix
"optimization".

But why are you even using cygpath to try and determine the containing
directory?  'dirname' does that task, in a much more portable manner,
and without having to worry about whether 'file/..' can be abused in
spite of POSIX semantics.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
@ 2013-09-18 15:20 David Griffiths
  2013-09-18 15:26 ` Eric Blake
  2013-09-18 17:31 ` bartels
  0 siblings, 2 replies; 14+ messages in thread
From: David Griffiths @ 2013-09-18 15:20 UTC (permalink / raw)
  To: cygwin

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.

Cheers,

Dave

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
  2013-09-17  9:33 ` Robert Klemme
@ 2013-09-17 13:32   ` Andrey Repin
  0 siblings, 0 replies; 14+ messages in thread
From: Andrey Repin @ 2013-09-17 13:32 UTC (permalink / raw)
  To: Robert Klemme, cygwin

Greetings, Robert Klemme!

>>> Yes, that's exactly right, assuming that 'boo' doesn't exist.
>>
>> Hi, it happens even if boo does exist. To put it in context, the
>> script in question was attempting to determine the current directory:
>>
>> CURRENT_DIR=$(cygpath -ma "${0}"/../)

> I am confused: do they need the current directory or the directory
> where the script resides?  The use of -m also sounds a bit weird to
> me.  I'd rather use -u or -w depending on who is supposed to use the
> value (i.e. a Windows process or a Unix Cygwin process).

I often prefer -m in case I need to pass this path to other, non-cygwin tools.
Though, there's less and less of these cases, thanks to continued effort of
community to provide a wide range of packages.

>> (I didn't write this script but I assume they did this for performance reasons.)

> For the same I'd rather do

> DIR_OF_SCRIPT=$(dirname "$0") && test -d "$DIR_OF_SCRIPT" || exit 1

>> But anyway, as you can see ${0} always exists.

> $ dash -c 'echo $0; for a; do echo "arg: $a"; done'
> dash
> $ dash -c 'echo $0; for a; do echo "arg: $a"; done' bla
> bla
> $ dash -c 'echo $0; for a; do echo "arg: $a"; done' bla foo
> bla
> arg: foo
> $ dash -c 'echo $0; for a; do echo "arg: $a"; done' -- bla foo
> --
> arg: bla
> arg: foo

> Kind regards

> robert



--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 17.09.2013, <16:58>

Sorry for my terrible english...


--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
  2013-09-16 13:30 David Griffiths
                   ` (2 preceding siblings ...)
  2013-09-16 22:03 ` Andrey Repin
@ 2013-09-17  9:33 ` Robert Klemme
  2013-09-17 13:32   ` Andrey Repin
  3 siblings, 1 reply; 14+ messages in thread
From: Robert Klemme @ 2013-09-17  9:33 UTC (permalink / raw)
  To: cygwin

On Mon, Sep 16, 2013 at 11:56 AM, David Griffiths
<david.griffiths@gmail.com> wrote:
>> Yes, that's exactly right, assuming that 'boo' doesn't exist.
>
> Hi, it happens even if boo does exist. To put it in context, the
> script in question was attempting to determine the current directory:
>
> CURRENT_DIR=$(cygpath -ma "${0}"/../)

I am confused: do they need the current directory or the directory
where the script resides?  The use of -m also sounds a bit weird to
me.  I'd rather use -u or -w depending on who is supposed to use the
value (i.e. a Windows process or a Unix Cygwin process).

> (I didn't write this script but I assume they did this for performance reasons.)

For the same I'd rather do

DIR_OF_SCRIPT=$(dirname "$0") && test -d "$DIR_OF_SCRIPT" || exit 1

> But anyway, as you can see ${0} always exists.

$ dash -c 'echo $0; for a; do echo "arg: $a"; done'
dash
$ dash -c 'echo $0; for a; do echo "arg: $a"; done' bla
bla
$ dash -c 'echo $0; for a; do echo "arg: $a"; done' bla foo
bla
arg: foo
$ dash -c 'echo $0; for a; do echo "arg: $a"; done' -- bla foo
--
arg: bla
arg: foo

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
  2013-09-16 13:30 David Griffiths
  2013-09-16 15:03 ` Robert Pendell
  2013-09-16 16:41 ` Christopher Faylor
@ 2013-09-16 22:03 ` Andrey Repin
  2013-09-17  9:33 ` Robert Klemme
  3 siblings, 0 replies; 14+ messages in thread
From: Andrey Repin @ 2013-09-16 22:03 UTC (permalink / raw)
  To: David Griffiths, cygwin

Greetings, David Griffiths!

>> Yes, that's exactly right, assuming that 'boo' doesn't exist.

> Hi, it happens even if boo does exist. 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.)

Glad you didn't... Because otherwise you would be the one to blame for the
problem.
$0 could easily NOT have any path, just a script name.

> But anyway, as you can see ${0} always exists.

Only theoretically.
Practice is that noone will bet a buck on it.

> I looked at the other thread but don't see an immediate connection as
> that was checking for non-existing path members.

If you want to obtain a full name of a running script, you'd need something
like this:

XXX="$(cygpath -au "$0")"
SCRIPT_NAME="$(readlink -fn "${XXX:-$0}")"

This is almost platform-independent, even. To the extent of readlink -f option
support.


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 17.09.2013, <00:19>

Sorry for my terrible english...


--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
  2013-09-16 13:30 David Griffiths
  2013-09-16 15:03 ` Robert Pendell
@ 2013-09-16 16:41 ` Christopher Faylor
  2013-09-16 22:03 ` Andrey Repin
  2013-09-17  9:33 ` Robert Klemme
  3 siblings, 0 replies; 14+ messages in thread
From: Christopher Faylor @ 2013-09-16 16:41 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
  2013-09-16 13:30 David Griffiths
@ 2013-09-16 15:03 ` Robert Pendell
  2013-09-16 16:41 ` Christopher Faylor
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Robert Pendell @ 2013-09-16 15:03 UTC (permalink / raw)
  To: cygwin

On Mon, Sep 16, 2013 at 5:56 AM, David Griffiths <> wrote:
>> Yes, that's exactly right, assuming that 'boo' doesn't exist.
>
> Hi, it happens even if boo does exist. 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.
>
> Cheers,
>
> Dave
>

I have no idea why they are doing that.  ${0} always gives back the
name of the program you ran.  It is very common to use $0 in scripts
in order to refer to itself in text given back to the user.

If you need to get the current directory $PWD is always available and
you don't need to use your own variable for it. (just like in linux,
unix, and other similar environments following that they are not
exactly equal)

For a reference point I'll give you what cygwin gave me when I ran the
command as you showed it.

Robert@Shinji-PC ~
$ cygpath -ma ${0}/../
cygpath: unknown option -- b
Try `cygpath --help' for more information.

That would be expected because for me ${0} (during echo) gave back
-bash as the output and cygpath will interpret that as additional
options.

I also checked to make sure cygpath is working as expected (at least
the way I think it should be working) and it tested ok.

Robert@Shinji-PC ~
$ uname -a
CYGWIN_NT-6.2-WOW64 Shinji-PC 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin

Robert@Shinji-PC ~
$ mkdir test

Robert@Shinji-PC ~
$ cygpath -m test/..
./

Robert@Shinji-PC ~
$ rmdir test

Robert@Shinji-PC ~
$ cygpath -m test/..
cygpath: error converting "test/.." - No such file or directory

I did find another odd bit with cygpath though.  It seems that if you
have .. to start the path to check it will translate it no matter
what.  A bug maybe?

(STC)
Robert@Shinji-PC ~
$ ls ../
Robert

Robert@Shinji-PC ~
$ ls ../test
ls: cannot access ../test: No such file or directory

Robert@Shinji-PC ~
$ cygpath -ma ..
D:/cygwin/home

Robert@Shinji-PC ~
$ cygpath -ma ../test
D:/cygwin/home/test


Robert Pendell
A perfect world is one of chaos.

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: cygpath -m behaviour change
@ 2013-09-16 13:30 David Griffiths
  2013-09-16 15:03 ` Robert Pendell
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: David Griffiths @ 2013-09-16 13:30 UTC (permalink / raw)
  To: cygwin

> Yes, that's exactly right, assuming that 'boo' doesn't exist.

Hi, it happens even if boo does exist. 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.

Cheers,

Dave

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-09-19 14:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-13 17:14 cygpath -m behaviour change David Griffiths
2013-09-13 18:14 ` Robert Pendell
2013-09-13 21:55   ` Christopher Faylor
2013-09-16 13:30 David Griffiths
2013-09-16 15:03 ` Robert Pendell
2013-09-16 16:41 ` Christopher Faylor
2013-09-16 22:03 ` Andrey Repin
2013-09-17  9:33 ` Robert Klemme
2013-09-17 13:32   ` Andrey Repin
2013-09-18 15:20 David Griffiths
2013-09-18 15:26 ` Eric Blake
2013-09-18 17:31 ` bartels
2013-09-19 14:36 David Griffiths
2013-09-19 16:16 ` Robert Klemme

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).