diff options
author | Spencer Judge <sjudge@tableausoftware.com> | 2015-04-07 14:18:43 -0700 |
---|---|---|
committer | Spencer Judge <sjudge@tableausoftware.com> | 2015-04-08 09:28:28 -0700 |
commit | a4448505688eeeaf165ded9f2dbb48e774ca67df (patch) | |
tree | 5744f49195e09e569187188808f09a50c167fcdc | |
parent | 2ae18234b0dc7d4c9968a827a5147806f35c3dbd (diff) | |
download | ninja-a4448505688eeeaf165ded9f2dbb48e774ca67df.tar.gz |
Fix backslashes in graphviz causing incorrect rendering on windows.
-rw-r--r-- | src/graphviz.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/graphviz.cc b/src/graphviz.cc index 8354a22..dce8b32 100644 --- a/src/graphviz.cc +++ b/src/graphviz.cc @@ -15,6 +15,7 @@ #include "graphviz.h" #include <stdio.h> +#include <algorithm> #include "graph.h" @@ -22,7 +23,9 @@ void GraphViz::AddTarget(Node* node) { if (visited_nodes_.find(node) != visited_nodes_.end()) return; - printf("\"%p\" [label=\"%s\"]\n", node, node->path().c_str()); + string pathstr = node->path(); + replace(pathstr.begin(), pathstr.end(), '\\', '/'); + printf("\"%p\" [label=\"%s\"]\n", node, pathstr.c_str()); visited_nodes_.insert(node); Edge* edge = node->in_edge(); |