On Wed, Mar 7, 2012 at 12:16 PM, Peter Maydell <peter.mayd...@linaro.org> 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.
>
> Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
> ---
> If I'd noticed when I was adding the banner to config.log that we already
> printed this in config-host.mak I'd have done it this way to start with...
>
>  configure |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/configure b/configure
> index a5eb832..1b63436 100755
> --- a/configure
> +++ b/configure
> @@ -22,7 +22,9 @@ rm -f config.log
>
>  # 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

You use an interesting feature of printf(1)- it applies the (short)
format string as long as there are arguments.  I checked that this is
in the specification:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan

Reply via email to