X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 17 Mar 2010 19:11:45 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: allow executing a path in backslash notation Message-ID: <20100317181145.GU6505@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <435451 DOT 56628 DOT qm AT web88306 DOT mail DOT re4 DOT yahoo DOT com> <20100316150700 DOT GZ6505 AT calimero DOT vinschen DOT de> <4BA119E0 DOT 60504 AT redhat DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BA119E0.60504@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: 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 Mar 17 12:05, Eric Blake wrote: > On 03/16/2010 09:07 AM, Corinna Vinschen wrote: > > I checked this situation in cmd.exe, and it is not capable of using > > paths relativ to %Path%. In other words, if %Path% contains a path > > c:\foo and you have two files C:\foo\baz.exe and C:\foo\bar\baz.exe, > > then calling "baz" works, but calling "bar\baz" fails. OTOH, the > > SearchPath function does it right. > > POSIX says PATH searches are only performed on single components; they > are skipped if the argument contains /. That is: > > PATH=/b c/d > > will NOT execute /b/c/d (unless you happen to be in /b at the time); > rather it MUST execute ./c/d or fail altogether. Another term for this > (at least, in the bash sources) is the notion of an anchored search - > even though the requested name is relative, the fact that it contains a > / means it does not trigger a PATH search, but is anchored in the > current directory. > > Therefore, I see no reason why we shouldn't behave the same for \, since > we are treating it as a directory separator. That is, if you have both > c:\foo\baz.exe and c:\foo\bar\baz.exe, then calling bar\baz should NOT > care whether c:\foo is in %Path%, but should only work if .\bar\baz exists. I have it on my todo list. But not for 1.7.2. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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