From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b587faeee5fad895 X-Google-Attributes: gid103376,public From: Geoff Bull Subject: Re: ada/c if - putenv? Date: 2000/03/08 Message-ID: <38C5A116.4AC1132D@research.canon.com.au>#1/1 X-Deja-AN: 594493590 Content-Transfer-Encoding: 7bit References: <38C53194.EE4BAC3E@mindspring.com> <38C58905.8E89F18E@acm.org> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@research.canon.com.au X-Trace: cass.research.canon.com.au 952475891 10681 203.12.174.227 (8 Mar 2000 00:38:11 GMT) Organization: Canon Information Systems Research Australia Mime-Version: 1.0 NNTP-Posting-Date: 8 Mar 2000 00:38:11 GMT Newsgroups: comp.lang.ada Date: 2000-03-08T00:38:11+00:00 List-Id: Jeff Carter wrote: > > Your program works fine as-is with GNAT 3.12p/Win98. > > I don't know how putenv is supposed to work, but that Free in your > Putenv procedure looks suspicious ... Yes that's it. man putenv gives this information: the string pointed to by string becomes part of the environment, so altering the string will change the environment. ... A potential error is to call the function putenv() with a pointer to an automatic variable as the argument and to then exit the calling function while string is still part of the environment. And deallocating the string is equally a problem. I've seen this answered here a few times over the years. Cheers Geoff