From ac7a2b8181ffc6706ea9ca552282a48ad3cfc8b4 Mon Sep 17 00:00:00 2001 From: David Holl Date: Fri, 5 Oct 2018 11:43:17 -0700 Subject: [PATCH] Escape " in target labels for dot output --- make2graph.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/make2graph.c b/make2graph.c index 844193d..9a6c918 100644 --- a/make2graph.c +++ b/make2graph.c @@ -358,10 +358,20 @@ static void DumpGraphAsDot(GraphPtr g,FILE* out) } else { + const char* label=targetLabel(g,t->name); fprintf(out, - "n%zu[label=\"%s\", color=\"%s\"];\n", - t->id, - targetLabel(g,t->name), + "n%zu[label=\"", + t->id); + while(*label) + { + if(*label=='\"') + fputs("\\\"",out); + else + fputc(*label,out); + label++; + } + fprintf(out, + "\", color=\"%s\"];\n", (t->must_remake?"red":"green") ); }