delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/13/08:00:44

Date: Sun, 13 Jun 1999 11:43:29 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Yogesh Sharma <SHARMAYOGESH AT prodigy DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: Changes to getenv.c
In-Reply-To: <7ju5dv$3bk2$1@newssvr01-int.news.prodigy.com>
Message-ID: <Pine.SUN.3.91.990613114308.17906d-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019