On Jul 12 21:01, Pavel Kudrna wrote:
> After that change cygwin_conv_to_posix_path() treats all following paths 
> in the same
> way:
> c:\     /cygdrive/c
> c:      /cygdrive/c
> c:\.\   /cygdrive/c/
> c:\.    /cygdrive/c
> c:.\    /cygdrive/c/./
> c:.     /cygdrive/c/.
> Before the suggested change last two items were slashified only.

C:. in DOS terms is *not* the same as /cygdrive/c/.  C:. is something
which has no meaning in the POSIX world.  There is no such thing as a
drive-relative current working directory [DCWD] in POSIX.  The above
conversion is plain wrong.  I don't see how converting a pure DOS-ism
into a wrong POSIX path is doing any good.

As for the idea to use the environment variables storing the DCWD in
Cygwin, these variables are being created by CMD.EXE(*).  So they don't
even exist if you start your shell without the detour of starting a
batch file.  They don't exist when you start your shell with a desktop
shortcut, by starting rxvt, or by starting your shell through a remote
ssh session.  Trick question:  How is Cygwin supposed to convert C:.
correctly when there's no information about the DCWD for drive C?

The bottom line is, I don't think it makes sense to convert C:. into a
POSIX path at all.


Corinna


(*) and, funny enough, there's no API call in Win32 to return a DCWD.
There's just a call GetCurrentDirectory() which returns *the* CWD.
Which makes sense, given that the RTL_USER_PROCESS_PARAMETERS can only
store one CWD per process.

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

Reply via email to