test/parser: Allow double-quotes in embedded config
[petitboot] / test / parser / extract-config.awk
index e7a5b33e72bbf4d3b0767cff1a5c782661395233..1ab68afa1bc91109fc3dba9fff149761ba2570d6 100644 (file)
@@ -2,7 +2,7 @@ BEGIN {
        config=0
 }
 
-/^#if\s*0\s*\/\*\s*PARSER_EMBEDDED_CONFIG/ {
+/^#if[ \t]*0[ \t]*\/\*[ \t]*PARSER_EMBEDDED_CONFIG/ {
        config=1
        print "#include <stdlib.h>"
        print "const char __embedded_config[] = "
@@ -17,5 +17,6 @@ BEGIN {
        exit
 }
 {
+       gsub("\"", "\\\"");
        print "\t\"" $0 "\\n\""
 }