Make bug

Guy Harris guy at rlgvax.UUCP
Fri Feb 15 12:43:41 AEST 1985


> > I recently found the following bug (feature?) in System 3, 5, OSx Make
> > in the following shell script:

...

> I guess it's fixed here!

That's probably because you're on a 4.2BSD system; it doesn't occur
here either.  From an article explaining the bug:

> David Tilbrook, Imperial Software Technology, London England in <305 at ist.UUCP>
> points up a bug in make whereby the shell's filename  expansion is suppressed
> when make is invoked:

> 	make -f - < descfile

> rather than:

> 	make -f descfile

> The bug is actually in /bin/sh.  In sh/expand.c around line 112 the shell
> attemps to open a directory to scan for file name expansions:

> 	if ((dirf = open(*s ? s : ".", 0)) > 0)

	...

> The asuumption is that open will never return 0; the check should be >= 0.

In a 4.2BSD version of the shell (any shell), this would be done with
"opendir"; in the process of changing the code to use the directory
library, one would almost certainly fix the bug (since the test would be
against a null pointer return).

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.unix.wizards mailing list