This might be a corner case, but I thought I'd flag it up anyway. I'll post
this letter to gmane.comp.gnu.mingw.msys also as the bug is their's.

>From a DOS cmd prompt, my PATH environment variable is:

J:\MINSYS\HOME\ANGUS> echo %PATH%
C:\PROGRA~1\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
"C:\Program Files\Norton SystemWorks\Norton Ghost\"

Note that the last entry here is enclosed in quotes. It's not me who put
that entry in. I guess that it's safe to assume that Norton knew what they
were doing.

Doing the same thing from a MinSYS terminal:

$ echo $PATH
.:/usr/local/bin:/mingw/bin:/bin:/c/Program Files/Perl/bin/:
/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:
"C:/Program Files/Norton SystemWorks/Norton Ghost/"

Ie, all is 'translated' as expected. However, all is not well when I try
and grab the path using getenv:

$ cat path.C
#include <cstdlib>
#include <iostream>

int main()
{
        char const * const path = getenv("PATH");
        std::cout << "PATH is " << path << std::endl;

        return 0;
}

$ g++ -o path path.C
$ ./path
PATH is .;J:\MinSYS\local\bin;j:\mingw\bin;
J:\MinSYS\bin;c:\Program Files\Perl\bin\;
c:\WINDOWS\system32;c:\WINDOWS;c:\WINDOWS\System32\Wbem;
"C;J:\MinSYS\Program Files\Norton SystemWorks\Norton Ghost\"

See what nastiness it's done to the quoted entry?

-- 
Angus

Reply via email to