diff options
author | Spencer Judge <sjudge@tableausoftware.com> | 2015-04-07 21:18:43 (GMT) |
---|---|---|
committer | Spencer Judge <sjudge@tableausoftware.com> | 2015-04-08 16:28:28 (GMT) |
commit | a4448505688eeeaf165ded9f2dbb48e774ca67df (patch) | |
tree | 5744f49195e09e569187188808f09a50c167fcdc /src/graphviz.cc | |
parent | 2ae18234b0dc7d4c9968a827a5147806f35c3dbd (diff) | |
download | Ninja-a4448505688eeeaf165ded9f2dbb48e774ca67df.zip Ninja-a4448505688eeeaf165ded9f2dbb48e774ca67df.tar.gz Ninja-a4448505688eeeaf165ded9f2dbb48e774ca67df.tar.bz2 |
Fix backslashes in graphviz causing incorrect rendering on windows.
Diffstat (limited to 'src/graphviz.cc')
-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(); |