Index: third_party/protobuf/src/google/protobuf/compiler/importer.cc |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/importer.cc b/third_party/protobuf/src/google/protobuf/compiler/importer.cc |
index 7689ce9351efbab447d93f79db7df08d599b37c6..422f759f2be75b21881f3591cef5cbd525b07a5b 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/importer.cc |
+++ b/third_party/protobuf/src/google/protobuf/compiler/importer.cc |
@@ -231,7 +231,12 @@ static string CanonicalizePath(string path) { |
// The Win32 API accepts forward slashes as a path delimiter even though |
// backslashes are standard. Let's avoid confusion and use only forward |
// slashes. |
- path = StringReplace(path, "\\", "/", true); |
+ if (HasPrefixString(path, "\\\\")) { |
+ // Avoid converting two leading backslashes. |
+ path = "\\\\" + StringReplace(path.substr(2), "\\", "/", true); |
+ } else { |
+ path = StringReplace(path, "\\", "/", true); |
+ } |
#endif |
vector<string> parts; |