On 11/19/2017 8:16 AM, Andreas K. Foerster wrote:
>
> Are there any documented limits for environment variables in DOS?
>
> My implementation uses a static buffer. So the content changes with
> every call to getenv. This is explicitly allowed by the standard.
>
> I don't want to make the buffer too large though, since space
> is so limited in small mode. Currently either the name or the content
> may not be larger than 126 characters. If the name is longer, it is
> not found. If the content is longer, it is truncated.
Yes, there is a limit. By default, it's 128 bytes, which can be
increased at the time of the start of command.com using the /L:xxxx
parameter, with xxxx in a range of 128 to 1024.
This space is inherited from the "master" each time you start a new
command.com and any changes to the environment variables of the new
command line are valid for that command line and do not alter the
"master" environment unless you explicitly try to alter the memory where
the "master" resides...

Ralf


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to