]> git.proxmox.com Git - mirror_qemu.git/commitdiff
bios-tables-test: fix ASL normalization false positive
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 28 Jul 2014 15:34:17 +0000 (17:34 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 29 Jul 2014 10:26:12 +0000 (12:26 +0200)
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 <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
tests/bios-tables-test.c

index 62771f760864f304e96133b08945f8b92d6a66e4..045eb27577b5126a828b5f298a6b98c91ce104e2 100644 (file)
@@ -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) */