Mail Archives: djgpp/1999/05/25/06:50:06
On Tue, 25 May 1999, Anton Helm wrote:
> The PCs are running W98 (most likely a french version, but I
> haven't yet found out definetly) and the "PATH" is spelled "Path"
> when you look at the environment with "set". Changing it to "PATH"
> seems to make it work correctly.
This would indicate that the variable set is "Path", not "PATH".
> My WinNT4.0 also uses "Path" but returns it's contents correctly when
> I call getenv("PATH").
That's because NT up-cases all environment variables that it passes to
DOS programs. If it didn't, nothing in DJGPP would work, because NT
always uses capitalized environment variables ("Path", "ComSpec" etc.).
> AFAIK DOS et. al. stores environmemt variables in the way they are typed in, but
> interpretes them caseINsensitive.
No. DOS doesn't treat environment variables case-insensitively. In
fact, DOS doesn't care (nothing in the DOS kernel ever accesses the
environment, AFAIK). It is COMMAND.COM and application programs that
access them, and they all treat them case-sensitively IIRC.
The impression that environment variables are caseless stems from the
fact that COMMAND.COM automatically up-cases the variable names (not
values, mind you) when you type "SET foo=bar" from the command line. So
there's no simple way for the user to set an environment variable whose
name isn't all upper-case.
- Raw text -