This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: default PATH


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]