From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5KS8-0006cH-7T for qemu-devel@nongnu.org; Wed, 07 Mar 2012 12:15:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5KRi-0001iw-MB for qemu-devel@nongnu.org; Wed, 07 Mar 2012 12:15:03 -0500 Message-ID: <4F579778.5010609@redhat.com> Date: Wed, 07 Mar 2012 19:14:32 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1331122589-15717-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1331122589-15717-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] configure: Quote the configure args printed in config.log List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org On 03/07/2012 02:16 PM, Peter Maydell wrote: > Use the same mechanism we use for printing the configure command > line to config-host.mak to print it to config.log. This fixes a > bug where the config.log version didn't quote arguments with spaces. > > # Print a helpful header at the top of config.log > echo "# QEMU configure log $(date)" >> config.log > -echo "# produced by $0 $*" >> config.log > +printf "# Configured with:" >> config.log > +printf " '%s'" "$0" "$@" >> config.log > +echo >> config.log > echo "#" >> config.log > This still breaks if an argument has a single quote. bash's printf's %q deals with this correctly, but not sure how portable it is. -- error compiling committee.c: too many arguments to function