[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Environment variables
> > What I want is to convert _all_ environment variables (which contain
> > file names/paths) to the Unix form in the startup code (not just the PATH
> > variable), and convert it back when spawning. To prevent environment
> sorry if i misunderstood, but how do you determine when the value of
> an environment variable contains directory paths (other than PATH which has
> predefined semantics) ?
The scheme I have in mind tries to do this "intelligently". I imagine
something like this:
Viariables that do not contain paths are treated "specially". When a program
starts, it determines which variables are "special" by reading a certain
environment variable we define (e.g. "SPECIAL"), which contains the names
of all "special" environment variables: for instance:
This would declare the UNIXMODE and FUBAR environment variables to be treated
specially, which means that no path conversion is done for these variables.
Additionally, any environment variable which already contains "/", and any
variable which is set (putenv()) to something containing a backslash, are
added to the SPECIAL list, which would also be exported when spawning.
Would this be too much trouble?