From patchwork Sat Oct 5 14:41:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Kerneis X-Patchwork-Id: 280773 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A1F6D2C00C1 for ; Sun, 6 Oct 2013 00:42:33 +1000 (EST) Received: from localhost ([::1]:52063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VST3u-0004aj-6y for incoming@patchwork.ozlabs.org; Sat, 05 Oct 2013 10:42:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VST3X-0004aO-1F for qemu-devel@nongnu.org; Sat, 05 Oct 2013 10:42:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VST3R-00083T-FL for qemu-devel@nongnu.org; Sat, 05 Oct 2013 10:42:06 -0400 Received: from wanbli.kerneis.info ([2001:41d0:8:38ad::1]:40514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VST3R-00082t-68 for qemu-devel@nongnu.org; Sat, 05 Oct 2013 10:42:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kerneis.info; s=wanbli-rsa1; h=Message-Id:Date:Subject:Cc:To:From; bh=lwZrnR8LuTgVMD7NNua5Y3rv0LJleb5+jzrKuFNT6aQ=; b=nO3ZrX2laxVXID8CGAxQVU9LFkLXPC/T8neEJJOIFCr2ECtquBki1rFIbP9HKfAZzKJLRZQXEB5j4VK6hIk1rAbJPV48DhQrpCLYumETX/NvWiSM4SRb8BOXrPYaQ3GxQju4oLrUJ18f9nAfdAdL160t96S9vbCCCbbDaNNngGg=; Received: from [176.248.82.32] (helo=wacehi.kerneis.info) by wanbli.kerneis.info with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1VST3J-0006Iz-3b; Sat, 05 Oct 2013 14:41:53 +0000 Received: from gabriel by wacehi.kerneis.info with local (Exim 4.80) (envelope-from ) id 1VST3I-0004p1-1u; Sat, 05 Oct 2013 15:41:52 +0100 From: Gabriel Kerneis To: qemu-devel@nongnu.org Date: Sat, 5 Oct 2013 15:41:32 +0100 Message-Id: <1380984092-18502-1-git-send-email-gabriel@kerneis.info> X-Mailer: git-send-email 1.8.4.rc3 X-SA-Exim-Connect-IP: 176.248.82.32 X-SA-Exim-Mail-From: gabriel@kerneis.info X-SA-Exim-Scanned: No (on wanbli.kerneis.info); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:41d0:8:38ad::1 Cc: pbonzini@redhat.com, Gabriel Kerneis Subject: [Qemu-devel] [PATCH] config-host.mak: escape configure arguments X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Escape single quotes and newlines when writing configure arguments to config-host.mak. This is necessary to allow correct regeneration by re-executing configure in a shell when config-host.mak becomes out-of-date. Signed-off-by: Gabriel Kerneis --- configure | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 23dbaaf..fba7c1f 100755 --- a/configure +++ b/configure @@ -3769,7 +3769,11 @@ echo "# Automatically generated by configure - do not modify" >config-all-disas. echo "# Automatically generated by configure - do not modify" > $config_host_mak printf "# Configured with:" >> $config_host_mak -printf " '%s'" "$0" "$@" >> $config_host_mak +for arg in "$0" "$@"; do + # join each arg on a single line, escaping newlines and single quotes + quoted_arg=$(echo "$arg" | sed ":a;N;s/\n/\\\\n/;ba" | sed "s/'/'\\\\''/g") + printf " '%s'" "$quoted_arg" +done >> $config_host_mak echo >> $config_host_mak echo all: >> $config_host_mak