Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: 4.2/sysV difference Message-ID: <3163@sun.uucp> Date: Thu, 16-Jan-86 15:35:06 EST Article-I.D.: sun.3163 Posted: Thu Jan 16 15:35:06 1986 Date-Received: Sat, 18-Jan-86 01:14:10 EST References: <160@cosivax.UUCP> Distribution: net Organization: Sun Microsystems, Inc. Lines: 23 > I was recently debugging a routine using "execvp". The bug was actually > On 4.2 systems the environment variable "PATH" used by "execvp" > to locate the directories to scan. The path elements (directories) > are separated by ':'. They can also be separated by '-'. > > If path=(/bin /usr/bin /usr/local ... /usr/new test-test), and > executable file in test-test, even when csh finds the executable, > a small test program doing execvp for the file doens't find it. > > It makes sense to me there is a reason for the termination of the > element by '-', but I can't figure out what the reason is. The reason is that at some point in UNIX's history (at AT&T, I presume), it was considered a feature that path elements could be separated by '-'. This was later changed, but the change didn't propagate instantaneously to all places where PATH variables were scanned. As such, any systems which still recognize '-' as a path separator have a bug. It was, conceivably, not fixed in UNIX/32V, which is what 4.xBSD is derived from. It is *STILL* not fixed in the System V, Release 2, VAX Version1 "make"! (Fix: get rid of the "*s1 != MINUS" clause in the first "while" loop in "execat" in "misc.c." It is, however, fixed in the 4.3BSD "execvp". Guy Harris