Skip to content

Commit

Permalink
Merge pull request #21 from dholl/master
Browse files Browse the repository at this point in the history
Escape " in target labels for dot output
  • Loading branch information
lindenb committed Oct 5, 2018
2 parents 61fb95a + ac7a2b8 commit 656a5a9
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions make2graph.c
Expand Up @@ -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")
);
}
Expand Down

0 comments on commit 656a5a9

Please sign in to comment.