From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC4xO-00088V-MK for qemu-devel@nongnu.org; Tue, 29 Jul 2014 06:48:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XC4xH-0001J1-5b for qemu-devel@nongnu.org; Tue, 29 Jul 2014 06:48:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC4xG-0001I4-PZ for qemu-devel@nongnu.org; Tue, 29 Jul 2014 06:48:27 -0400 Date: Tue, 29 Jul 2014 12:48:34 +0200 From: "Michael S. Tsirkin" Message-ID: <1406630860-13530-4-git-send-email-mst@redhat.com> References: <1406630860-13530-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1406630860-13530-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 3/8] bios-tables-test: fix ASL normalization false positive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Fam Zheng , Marcel Apfelbaum , Alexey Kardashevskiy , Gabriel Somlo , Anthony Liguori , Paolo Bonzini , Laszlo Ersek From: Paolo Bonzini My version of IASL (from RHEL7) puts two newlines between the head comment and the DefinitionBlock property. Kill all newlines after the comment, so that normalize_asl works properly. Signed-off-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Laszlo Ersek --- tests/bios-tables-test.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 62771f7..045eb27 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -487,7 +487,11 @@ static GString *normalize_asl(gchar *asl_code) /* strip comments (different generation days) */ comment = g_strstr_len(asl->str, asl->len, COMMENT_END); if (comment) { - asl = g_string_erase(asl, 0, comment + sizeof(COMMENT_END) - asl->str); + comment += strlen(COMMENT_END); + while (*comment == '\n') { + comment++; + } + asl = g_string_erase(asl, 0, comment - asl->str); } /* strip def block name (it has file path in it) */ -- MST