Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jan 2012 10:27:41 -0500
From:      Eitan Adler <eadler@freebsd.org>
To:        freebsd-bugs@freebsd.org
Subject:   Re: bin/164361: make handles "+=" incorrectly when the variable has zero length
Message-ID:  <CAF6rxgn3sjeMAZ=TGG=BR%2BSxwHhGM5LZNjG7UvGfBFi%2BjpaUrA@mail.gmail.com>
In-Reply-To: <201201220349.q0M3ntNQ047618@freefall.freebsd.org>
References:  <201201220349.q0M3ntNQ047618@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
---------- Forwarded message ----------
From: Jilles Tjoelker <jilles@stack.nl>
Date: Sun, Jan 22, 2012 at 8:24 AM
Subject: Re: bin/164361 quick question about make
To: Eitan Adler <lists@eitanadler.com>

On Sun, Jan 22, 2012 at 12:48:49AM -0500, Eitan Adler wrote:
> Is the behavior reported in bin/164361 actually a bug?
> http://pubs.opengroup.org/onlinepubs/009695399/utilities/make.html
> appears to have comment on +=
> The patch provided seems to fix the issue for me, but is it correct?

I cannot find mention of += in the POSIX specification for make, but
there is a proposal to add it at
http://austingroupbugs.net/view.php?id=330 .

This proposal appears to describe exactly what we do: if the variable
already exists, a space is inserted between the old and the new value,
even if the old value is null.

The same happens in gmake and bmake (with the example).

Because an extraneous space is unlikely to cause problems (sh treats two
unquoted spaces the same as a single unquoted space), it seems unwise to
change this.


-- 
Eitan Adler
Source & Ports committer
X11, Bugbusting teams



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF6rxgn3sjeMAZ=TGG=BR%2BSxwHhGM5LZNjG7UvGfBFi%2BjpaUrA>