This is the mail archive of the 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: Zsh filename completion sluggishness?

Christopher Faylor <> writes:

> On Fri, Feb 14, 2003 at 10:12:54AM -0700, Matt Armstrong wrote:
>>In the Win32 world, quotes around path elements are valid.  If I have:
>>    PATH="c:\foo bar"
>>cmd.exe will find executables in that dir.
>>When I run bash or zsh, things in "c:\foo bar" aren't found.
> This is a UNIX emulation environment.  "c:\foo bar" doesn't mean the c drive
> in a PATH variable.  It means the 'c' directory followed by the '\foo bar'
> directory.  Colon is the separator for PATH.
> The correct syntax for the above is PATH="/cygdrive/c/foo bar" .

I understand completely -- as I said somewhat ambiguously I was
setting the path to "c:\foo bar" in cmd.exe, then running bash.

When Cygwin initializes its PATH from the Win32 one, it doesn't handle
quoted elements properly.

E.g. cygwin converts the Win32 path like this:

    c:\foo;"c:\bar" -> /cygdrive/c/foo:"c:\bar"

But it should do this:

    c:\foo;"c:\bar" -> /cygdrive/c/foo:/cygdrive/c/bar

The latter is the semantic equivalent to the Win32 path.

The session below describes exactly what I'm talking about.

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>cd foo bar

C:\foo bar>dir
 Volume in drive C is MYDISK
 Volume Serial Number is 7C67-4A84

 Directory of C:\foo bar

02/14/2003  10:01a      <DIR>          .
02/14/2003  10:01a      <DIR>          ..
02/14/2003  10:01a                  19 foobar.cmd
               1 File(s)             19 bytes
               2 Dir(s)   1,021,567,488 bytes free

C:\foo bar>cd ..

'foobar' is not recognized as an internal or external command,
operable program or batch file.

C:\>set PATH="c:\foo bar";%PATH%


C:\>echo I ran foobar!
I ran foobar!

C:\>cd cygwin


maarmstr@MAARMSTR ~
$ which foobar.cmd
foobar.cmd: Command not found.

maarmstr@MAARMSTR ~
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:"c:/foo bar":/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/WINNT/System32/Wbem:/bin:/usr/bin:/usr/X11R6/bin

maarmstr@MAARMSTR ~
$ export PATH='/cygdrive/c/foo bar':$PATH

maarmstr@MAARMSTR ~
$ which foobar.cmd
/cygdrive/c/foo bar/foobar.cmd

maarmstr@MAARMSTR ~


Unsubscribe info:
Bug reporting:

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