delorie.com/archives/browse.cgi   search  
Mail Archives: opendos/1997/03/07/18:13:16

Message-Id: <9703072210.AA03678@hum.amu.edu.pl>
Comments: Authenticated sender is <grendel AT ananke DOT amu DOT edu DOT pl>
From: "Mark Habersack" <grendel AT ananke DOT amu DOT edu DOT pl>
Organization: KGB
To: "'OpenDOS Mailing List'" <opendos AT mail DOT tacoma DOT net>
Date: Fri, 7 Mar 1997 23:05:51 +0100
Mime-Version: 1.0
Subject: (Fwd) Re: [opendos] OD case sensitivity
Reply-To: grendel AT ananke DOT amu DOT edu DOT pl
Sender: owner-opendos AT mail DOT tacoma DOT net

------- Forwarded Message Follows -------
From:          Self <grendel>
To:            "Matthias Paul" <MPAUL AT ibh DOT rwth-aachen DOT de>
Subject:       Re: [opendos] OD case sensitivity
Reply-to:      grendel AT ananke DOT amu DOT edu DOT pl
Date:          Thu, 6 Mar 1997 20:08:22 +0100

On  6 Mar 97 (at 15:08) Matthias Paul became famous by saying:

> > > When I've changed the 'set path=c:\opendos' to 'set PATH=c:\opendos' in
> > > dconfig.sys - everything went just OK.
> > >
> > > Conclusion: OpenDOS internally pays attention to the env. variable's
> > > case and programs that do 'getenv("PATH")' receive NULL. Or... what else
> > > could it be?
> 
> There is a great difference between the CONFIG.SYS pre-environment 
> and its related SET= directive, and the later environment, to be used
> in batchjobs...
The problem (or feature) certainly lies inside the OD kernel. The environment
management functions do not uppercase the environment strings. This is a
feature IMHO, but is (1) non-conforming with M$-DOG specs (which,
unfortunately, should be followed as M$-DOG is a, de facto, standard) and (2)
very troublesome with a great majority of applications that do not expect this
behavior.

> The normal environment functions (batchjobs) are not case-sensitive, 
> that is, if you set new environment variables, they will be upstringed
> before they appear in the environment.  If you test on environment 
> variables e.g. using IF "%var1%"=="%var2%" ..., both sides are 
> upstringed.
That's because the translation is being done inside the command shell. So, the
statement above is not deterministic.

> However, the CONFIG.SYS SET= directive works very different:
> 
> - It does *not* upstring variables before putting them into the 
>   pre-environment.
> 
> - It does not clear or overwrite already existing entries. 
>   In fact, if you do:
> 
>    SET test=Hello
>    SET test=World!
>    SET test=
>    SET path=c:\opendos
> 
>   the pre-environment will actually contain:
> 
>    test=Hello
>    test=World!
>    test=
>    path=c:\opendos
That's right. THe reason for this is that the pre-environment job is done by
the kernel while the autoexec.bat processing takes part in the command shell.

>   Some may call this a bug, but it's also a feature, if it's known...
>   (Mind, that a pre-environment was introduced with DR DOS 6.0, long
>   before MS-DOS 6.0 did it rather differently).
I consider this to be a feature, but also a cause for headaches for some,
unexperienced, users. So, the conclusion is that the feature should be made
optional.

>   Normally, when loading COMMAND.COM via SHELL = /P, it will parse 
>   the pre-environment and create a master-environment from it,
>   stripping out those doubled definitions, and so forth... 
> 
>   It will *not* upstring these strings!  When using these variables 
>   in batchjobs, there won't be problems, since the variables will be
>   upstringed before the test.  If you use your compilers runtime
>   library functions, depending on your compiler, you need to test 
>   for both, upcase and lowcase variants, which, of course, is not 
>   very convenient.  You may patch your RTL (if I remember well, 
>   Borland/Turbo Pascal libraries upstring the environment 
Not really. Unless the RTM.EXE is not written using Borland compiler ;-))

>   internally).  However, you always need to upstring the resulting 
>   string (and always had to do this in the past).
> 
>   4DOS & NDOS do not evaluate the pre-environment, when they build
>   the master-environment from it.  They just take it over.  
>   So, strange side effects appear with these command processors, 
>   if you don't upstring all your CONFIG.SYS SET= directives.
> 
>   To avoid some of the problems, 4DOS & NDOS have with DR DOS style
>   pre-environments, you should insert:
> 
>    IF "4"=="%@Eval[2+2]%" c:\opendos\command.com /C EXIT
Or just put it in the 4start.btm


-----------Visit http://ananke.amu.edu.pl/~grendel-------------
Sometimes there's nothing to feel, sometimes there's nothing to
hold. Sometimes there's no time to run away, sometimes you
just feel so old. The times it hurts when you cry, the times it
hurts just to breathe. And then it seems like there's no-one
left, and all you want is to sleep. Fight, fight, fight - just
push it away. Fight, fight, fight - just push it until it breaks

- Raw text -


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