This is the mail archive of the cygwin 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: environment variable name converted to upper case


Larry Hall wrote:

I'm not sure what you mean by 'Posix shells'.  Shells that come with the
Cygwin environment don't expect uppercase.  Windows (and DOS) do, really.

OK, I was a little imprecise.


What I was trying to say was that NT *shells* preserves case in environment variables, but is case-insensitive in lookup. Which is why it allows variables like "Path" or "PATH" interchangeably. You can set "foo", but look up "%FoO%" or "%fOo", and it'll find that "foo" and return it. But just "set" prints out "foo=...", not "FOO=...".

"Posix shells" (OK, another bad term - I mean shells originally written to run on Unix-y or Posix-y systems - i.e. sh, bash, ksh, csh, etc., but not CMD, COMMAND.COM, 4NT, or others), on the other hand, are completely case-preserving and case-sensitive.

And in order to be able to see PATH in the environment in cygwin shells when the system had set Path, cygwin uppercases all environment vars when starting a cygwin process. What I was saying was, how about uppercasing just "Path/PATH"? We can leave the case of the others alone, as they are in the system environment.

OK, sure, there's minor complexity in saying

  if (stricmp(var, "path") == 0)
    uppercase(var)

instead of just

uppercase(var)

but it reduces the needless element of surprise at the unnecessary munging of the environment.

Anyway, not a big point; just a suggestion, and it looks like it's been shot down. That's ok..


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


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