Date: Sun, 8 Aug 1999 14:24:11 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: "Mark E." cc: djgpp-workers AT delorie DOT com Subject: Re: possible bug in spawn* In-Reply-To: <199908061553.PAA52260@out5.ibm.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Fri, 6 Aug 1999, Mark E. wrote: > If I run a program and the program name is in the '/dev/' format, > shouldn't argv[0] be converted to regular DOS format (c:/djgpp/bin...)? I don't know. Why should it? Does it break something? In my testing I didn't have any problems with `spawn*' and /dev/foo names. (There's a special test program in djtst203.zip written specifically to test all library functions that accept file names, including spawnXX.) In general `spawn*' leaves argv[0] as it was passed by the caller, which is the reason why sometimes it is passed without the leading directories. It's an old issue which we decided not to touch when v2.01 was in beta. In this case, converting the name back to c:/foo form might fail in some cases, if the invoked program doesn't like the DOS drive letter braindamage. > The source does convert program to c:/... form, but not until after > the path has been copied to argv[0]. The program pathname is converted to the usual DOS form (by calling `_put_path2') because otherwise DOS won't find it: it doesn't know about all that /dev/foo magic. Note that what's converted is NOT argv[0], which is in a different string: the caller should be able to pass two different strings in argv[0] and in the actual program name.