X-Spam-Check-By: sourceware.org Date: Fri, 10 Feb 2006 20:01:16 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: default PATH Message-ID: <20060210190116.GL14219@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <43E9ECB4 DOT 1070905 AT byu DOT net> <006b01c62ce1$c3ae94a0$a501a8c0 AT CAM DOT ARTIMI DOT COM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006b01c62ce1$c3ae94a0$a501a8c0@CAM.ARTIMI.COM> User-Agent: Mutt/1.4.2i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 Feb 8 18:59, Dave Korn wrote: > On 08 February 2006 13:06, Eric Blake wrote: > > Yes, this is correct behavior, but it often catches people by surprise. > > POSIX requires an empty string in your PATH to be treated as the current > > directory, and while people are less likely to start their Windows PATH > > with ; or to have ;; in the middle, a trailing ; is pretty common from > > applications that don't know any better on Windows. > > No, it's not quite correct behaviour - but the incorrectness isn't in the interpretation of $PATH, but in the way it is translated > from %PATH%. > > Since POSIX semantics requires an empty path component to be treated as > $CWD, but Win32 semantics require an empty path component to be ignored, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ How do you know that? Can you give me a pointer describing that? I searched MSDN and KB and found not a word about how multiple semicolons are treated by Win32 functions or cmd/command. This is tricky to test since, for instance, CreateProcess searches the current directory anyway before using %PATH% (see MSDN). > the code that translates %PATH% to $PATH is not performing > the translation correctly. It should strip out empty components from > the win32 path if it wants to get a semantically-equivalent path > setting. Translating an empty win32 path component into an empty > posix path component is not translating like into like. I'm wondering how other people think of that. In theory we could change Cygwin to ignore ";;" sequences and not to add "." to $PATH, or we can just keep it as it is. There are two different points of view possible here: - Changing an empty Win32 path component to a POSIX "." entry is in Cygwin for a long time. It's possible that people rely on this behaviour, so changing it would break existing installations. Removing "." from $PATH could easily be accomplished in a script. - Changing an empty Win32 path component to a POSIX "." entry is an inherently dangerous behaviour and should not be done automatically. Adding "." to $PATH could easily be accomplished in a script. So, what's the way to go? Any third possibility perhaps? Corinna -- 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/