assert no slashes in default GetNode
authorScott Graham <scottmg@chromium.org>
Sun, 9 Nov 2014 07:10:34 +0000 (23:10 -0800)
committerScott Graham <scottmg@chromium.org>
Sun, 9 Nov 2014 07:10:34 +0000 (23:10 -0800)
src/state.cc

index b6c29ff..7d1d79d 100644 (file)
@@ -112,6 +112,9 @@ Edge* State::AddEdge(const Rule* rule) {
 }
 
 Node* State::GetNode(StringPiece path) {
+#if defined(_WIN32) && !defined(NDEBUG)
+  assert(strpbrk(path.AsString().c_str(), "/\\") == NULL);
+#endif
   return GetNode(path, 0);
 }