delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/07/13/03:37:45

X-Spam-Check-By: sourceware.org
Date: Fri, 13 Jul 2007 09:37:25 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: bug in cygwin_conv_to_posix_path() caused by period in win32 path
Message-ID: <20070713073725.GJ6851@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <468A1024 DOT 8000007 AT mff DOT cuni DOT cz> <468A441A DOT 2000009 AT cygwin DOT com> <468B657B DOT 3050306 AT mff DOT cuni DOT cz> <20070704213927 DOT GC16838 AT trixie DOT casa DOT cgf DOT cx> <468D70E6 DOT 4070403 AT mff DOT cuni DOT cz> <468D75C5 DOT 5050507 AT cygwin DOT com> <20070706001522 DOT GB22578 AT ednor DOT casa DOT cgf DOT cx> <46967A99 DOT 5040208 AT mff DOT cuni DOT cz>
Mime-Version: 1.0
In-Reply-To: <46967A99.5040208@mff.cuni.cz>
User-Agent: Mutt/1.4.2.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019