Path: utzoo!attcan!uunet!husc6!cmcl2!phri!dasys1!tneff From: tneff@dasys1.UUCP (Tom Neff) Newsgroups: comp.sys.ibm.pc Subject: Re: Another twist on DOS environment sizes. Summary: allocate dummy env variable before shelling Message-ID: <4598@dasys1.UUCP> Date: 24 May 88 15:54:43 GMT References: <629@fxgrp.UUCP> Reply-To: tneff@dasys1.UUCP (Tom Neff) Organization: Independent Users Guild Lines: 27 In article <629@fxgrp.UUCP> ljz%fx.com@ames.arc.nasa.gov (Lloyd Zusman) points out that most programs don't allocate any extra environment space when shelling down to COMMAND.COM, regardless of whether you have done so yourself at the top level with a /E:XXXX switch in CONFIG.SYS. Instead, the shelled process gets an environment segment just large enough to contain the SETs used by the parent process, leaving little or no room for expansion at the child level. He mentions two possible workarounds -- patching COMMAND.COM for a larger default environment size, and including another /E:XXXX switch in each COMMAND.COM line used for shelling. Both have obvious limitations, and he asks: >Can any of you think of any other way around this problem? Yes. Before you shell, issue a dummy SET XX=XXXXXXX.... of sufficient length to (a) cover your child process's anticipated needs, or (b) fill the environment segment, whichever. Then when your child process receives control from the shell operation, the first thing it does is clear the dummy SET leaving lots of free space to work with. This is guaranteed to work with all flavors of DOS and requires no special version specific knowledge, so I recommend it instead of patches etc. -- Tom Neff UUCP: ...!cmcl2!phri!dasys1!tneff "None of your toys CIS: 76556,2536 MCI: TNEFF will function..." GEnie: TOMNEFF BIX: are you kidding?