delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/29/14:15:33

From: "A. Sinan Unur" <sinan DOT unur AT cornell DOT edu>
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: <spark-2901980201090001 AT p113-thalia DOT es DOT co DOT nz>
NNTP-Posting-Host: cu-dialup-0043.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Zippy wrote:
<snip> 
> #include <stdio.h>
> 
> 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.

<snip>
> 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019