Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 exptools 1/6/84; site iham1.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxj!houxm!ihnp4!iham1!fcy
From: fcy@iham1.UUCP (Fred Yankowski)
Newsgroups: net.bugs.usg
Subject: Apparent bug in 'make': hyphen treated as delimiter in $PATH
Message-ID: <286@iham1.UUCP>
Date: Thu, 17-Jan-85 10:52:47 EST
Article-I.D.: iham1.286
Posted: Thu Jan 17 10:52:47 1985
Date-Received: Fri, 18-Jan-85 02:40:40 EST
Organization: AT&T Bell Labs, Naperville, IL
Lines: 27

The standard SVR2 'make' command ("/bin/make") has a bug/misfeature
that arises when directories in ones $PATH contain a hyphen '-' in
their name.  When 'make' attempts to execute a command that does not
contain any /bin/sh constructs (e.g., '|', '>', '`') and does not
have a '/' in the command name, it calls a built-in version
of 'execvp()' which attempts to execute the command (via 'exec(2)')
by constructing a full pathname from successive elements in $PATH
and the supplied basename.  The problem is that both ':' and '-' are
treated as separators in $PATH; consequently a
$PATH like
	/bin:/user1/foo-bar/bin
is treated as if it contains three directories --
	/bin
	/user1/foo
	bar/bin
-- and any commands in /user1/foo-bar/bin are unreachable by 'make'.

This is particularly annoying since the local administrators have
taken to putting non-standard software (such as that for the DMD
5620) under the "/usr/add-on" directory, which contains the deadly
hyphen.

The offending code can be found in "/usr/src/cmd/make/misc.c" in the
functions 'execvp()' and 'execat()'.


    Fred Yankowski ::: AT&T Bell Laboratories ::: ihnp4!iham1!fcy