Date: Fri, 18 Jan 2002 17:10:02 -0800 (PST) From: Alan Eldridge <alane@geeksrus.net> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/34032: make fails to evaluate some reasonable conditional expressions Message-ID: <200201190110.g0J1A2S99157@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/34032; it has been noted by GNATS. From: Alan Eldridge <alane@geeksrus.net> To: "Crist J . Clark" <cjc@FreeBSD.ORG> Cc: Alan Eldridge <ports@geeksrus.net>, FreeBSD-gnats-submit@FreeBSD.ORG, sobomax@FreeBSD.ORG Subject: Re: bin/34032: make fails to evaluate some reasonable conditional expressions Date: Fri, 18 Jan 2002 20:06:07 -0500 On Fri, Jan 18, 2002 at 01:53:02PM -0800, Crist J . Clark wrote: >In this case, make(1) should never be evauating the "broken" >code. Since the Makefile syntax of the conditional as a whole is OK, >provided you don't actually try to evaluate it, I would expect this to >work. Yup. It should. If we look at cond.c, we see that it still parses the rest of the conditional to eat it, in case it's embedded in a larger test. The real problem occurs in var.c. Down at the end, when Var_Parse() is cleaning up (lines 2269-2288), it basically says: if (var flags & JUNK) { // not in symbol tables if (built-in dynamic var like .CURRENT) { handle this case } else { str = var_Error } } return str The problem is that Var_Parse() is passed a flag telling whether or not to complain about undefined vars -- a value called "err". But err is not checked in this last case. So here's the fix: --- var.c.orig Thu Oct 19 00:23:49 2000 +++ var.c Fri Jan 18 19:50:39 2002 @@ -2283,7 +2283,7 @@ str[*lengthPtr] = '\0'; *freePtr = TRUE; } else { - str = var_Error; + str = err ? var_Error : varNoError; } } return (str); -- Alan Eldridge Pmmfmffmmfmp mmmpppppffmpmfpmpppff PmpMpmMpp ppfppp MpfpffmppmppMmpFmmMpm mfpmmmmmfpmpmpppff. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201190110.g0J1A2S99157>