From: "A. Sinan Unur" Newsgroups: comp.os.msdos.djgpp Subject: Re: why won't my .exe program run properly until I set env var? Date: Wed, 28 Jan 1998 08:14:09 -0500 Organization: Cornell University (http://www.cornell.edu/) Lines: 32 Sender: asu1 AT cornell DOT edu (Verified) Message-ID: <34CF2F21.6A3A0E01@cornell.edu> References: NNTP-Posting-Host: cu-dialup-0043.cit.cornell.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Zippy wrote: > #include > > main(int argc, char *argv[]) > { > char *d, *p, *n, *e; > int dummy = fnsplit(argv[1], d, p, n, e); > /* This splits a filename into drive, path, name and extension. */ > > dummy = rename("oldname.txt", strcat(n, ".txt")); > } i would suggest you type "info libc alpha fnsplit" on the command line and read the documentation carefully. if d, p, n and e are not NULL, they have to point to something. in this case, they are not initialized. you will get different results based on what crazy values they end up taking. > I managed to > trace the problem down to the environment variable not being set, in light of the above, this sounds like a red herring. -- ---------------------------------------------------------------------- A. Sinan Unur Department of Policy Analysis and Management, College of Human Ecology, Cornell University, Ithaca, NY 14853, USA mailto:sinan DOT unur AT cornell DOT edu http://www.people.cornell.edu/pages/asu1/