delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/22/18:16:23

Date: Mon, 22 Jul 1996 18:16:11 -0400
Message-Id: <199607222216.SAA10061@delorie.com>
From: DJ Delorie <dj>
To: vazndain AT pit DOT ktu DOT lt
CC: djgpp AT delorie DOT com
In-reply-to: <Pine.SOL.3.91.960722112637.25809A-100000@zalgiris> (message from
Orbital on Mon, 22 Jul 1996 11:43:14 +0300)
Subject: Re: bug in exec/spawn ?

> I wrote this program which loads its confguration file from the directory
> where the executable is. I use argv[0] to determine it. However, when my 
> program is invoked from make or rhide, it can never find the cfg file. I 
> wrote a little test prg, smth like puts(argv[0]); and when invoked from 
> make or rhide it displays *only* its name, *without* the path. What gives?

Any V2 program calling another V2 program can specify whatever it
wishes in argv[0], even the words "peanut butter" (to pick an
example).  There is little that can be done about this.

Perhaps we should add a crt0 flag to disallow argv[0] overrides?
You'd then get what DOS wants you to see, not the program, which might
cause other problems.

- Raw text -


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