[alt.msdos.programmer] Turbo C PUTENV/GETENV

cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) (11/28/89)

   I'm writing a program under Turbo C 2.0 which has to be able to maniuplate
its own environment (I'm not talking about updating the previous shell's
copy of the enviornment, just its own) and I'd like to be able to pass
this environment along to child processes.  The problems I've discovered are:

- although the documentation says that the environment table may be moved
  and reorganized depending on its space needs, the most I can add is usually
  one entry.  Any subsequent entires added overwrite the first one I add.

- the manual says "Delete an existing entry by making the variable value
  empty (for example, MYVAR=)"  When this is done, however, I end up with
  an entry in the table saying exactly that:  MYVAR=, which is not what is
  wanted.

- if I add a line (say FOO=BAR) to the environment and then invoke a child
  process, with through system or by spawnle-ing, that line will be changed
  to an entry saying simply "and".  This will appear in the environment of
  the child and also in the parent's environment.

   If it matters, I'm using the small memory model.  Is there any way to
fix these problems short of writing my own environment management routines?
-- 
Stephen M. Dunn                               cs4g6ag@maccs.dcss.mcmaster.ca
          <std_disclaimer.h> = "\nI'm only an undergraduate!!!\n";
****************************************************************************
They say the best in life is free // but if you don't pay then you don't eat