| 107 | } |
| 108 | |
| 109 | bool FixBazelEnvPath(const char* path, string* out) { |
| 110 | if (path == nullptr) return false; |
| 111 | if (out == nullptr) return true; |
| 112 | |
| 113 | *out = path; |
| 114 | |
| 115 | #ifdef PLATFORM_WINDOWS |
| 116 | // On Windows, paths generated by Bazel are always use `/` as the path |
| 117 | // separator. This prevents normal path management. In the event there are no |
| 118 | // `\` in the path, we convert all `/` to `\`. |
| 119 | if (out->find('\\') != string::npos) return path; |
| 120 | |
| 121 | for (size_t pos = out->find('/'); pos != string::npos; |
| 122 | pos = out->find('/', pos + 1)) { |
| 123 | (*out)[pos] = kPathSep[0]; |
| 124 | } |
| 125 | #endif |
| 126 | |
| 127 | return true; |
| 128 | } |
| 129 | } // namespace internal |
| 130 | |
| 131 | bool IsAbsolutePath(StringPiece path) { |
no test coverage detected