Mail Archives: djgpp/1999/06/13/08:00:44
On Sat, 12 Jun 1999, Yogesh Sharma wrote:
> Below is the source for getenv.c. I am planning to change the following line
> :
> while (*ep && *np && *ep == *np && *np != '=')
>
> To
> while (*ep && *np && toupper(*ep) == toupper(*np) && *np != '=')
>
> Reason for changing this
>
> DOS is not a case sensitive OS, so why don't we convert the environment
> variable and search variable to upper case so that the users may not have
> any problem regarding the case.
DJGPP is free software, so you are free to change your copy of the
sources as you see fit.
However, please note that this change is IMHO *wrong*. First, DOS is
NOT case-insensitive as far as environment variables are concerned.
For example, I have yet to see a DOS compiler which has a
case-insensitive `getenv'.
And second, the DOS shell COMMAND.COM (and its close work-alikes)
upcases the name of the variable when you type it from the command
line, so I fail to see how users can have any problems with this
issue.
On the other hand, if you _do_ make `getenv' case-insensitive, you
might break some of the DJGPP internal operation in subtle ways. Some
of the features, like long command lines passed to subsidiary
programs, depend on certain special environment variables being in
*lower* case, precisely because there's little or no chance that a
user could ever define such a variable from the command line.
- Raw text -