public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: cyg Simple <cygsimple@gmail.com>
To: cygwin@cygwin.com
Subject: Re: error in "cygpath" behavior
Date: Fri, 31 Aug 2018 22:34:00 -0000	[thread overview]
Message-ID: <5f5472d0-bdee-56d0-7549-41e83d48e6bc@gmail.com> (raw)
In-Reply-To: <20180831085734.GF6350@calimero.vinschen.de>

On 8/31/2018 4:57 AM, Corinna Vinschen wrote:
> On Aug 30 21:37, Steven Penny wrote:
>> It is my understanding that given relative input, "cygpath" shall produce
>> relative output unless given "-a" option. However I noticed a discrepancy. These
>> are all correct:
>>
>>    $ cygpath .
>>    .
>>
>>    $ cygpath ..
>>    ..
>>
>>    $ cygpath -w .
>>    .
>>
>> This is not:
>>
>>    $ cygpath -w ..
>>    C:\cygwin64\home\
> 
> Long-standing behaviour.  ".." in Cygwin and ".." in Windows can totally
> disagree.  The path is always convert to absolute at this point in favor
> of correct output.  There's also the additional restriction (though
> not in this case) that relative Windows paths must not be longer than
> MAX_PATH (260) chars.
> 
> I'm certainly open to patches to the underlying cygwin_conv_path
> function to change the Windows path to relative if possible.

Don't forget the possibility that '..' points to a symlink which Windows
will not understand.

$ mkdir -p /foo/baz
$ ln -s /foo /bar
$ cd /bar/baz
$ cygpath -w ..

-- 
cyg Simple

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

  reply	other threads:[~2018-08-31 19:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 15:29 Steven Penny
2018-08-31 19:36 ` Corinna Vinschen
2018-08-31 22:34   ` cyg Simple [this message]
     [not found]     ` <ad34f7a7-ec71-de69-b2d2-711c2e8d61b0@redhat.com>
2018-09-01  7:17       ` Thomas Wolff
     [not found]   ` <5b89c269.1c69fb81.84d1a.6f1b@mx.google.com>
2018-09-01  6:40     ` Achim Gratz
2018-09-01  6:54     ` Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f5472d0-bdee-56d0-7549-41e83d48e6bc@gmail.com \
    --to=cygsimple@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).