aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/importer.cc
diff options
context:
space:
mode:
authorGravatar liujisi@google.com <liujisi@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2010-12-07 06:23:55 +0000
committerGravatar liujisi@google.com <liujisi@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2010-12-07 06:23:55 +0000
commit1fd96c43a01ec913a89de31c58c0bc9f1e5bf542 (patch)
treefd75a0bffe10b1e57155cbf70d32d41e44302be0 /src/google/protobuf/compiler/importer.cc
parentb4d64bf7f3aa65318a5262977e59f42595c4c5d0 (diff)
Add new files for vcprojs, fix issues: 165, 211, 228, 240
Diffstat (limited to 'src/google/protobuf/compiler/importer.cc')
-rw-r--r--src/google/protobuf/compiler/importer.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/importer.cc b/src/google/protobuf/compiler/importer.cc
index 7689ce93..422f759f 100644
--- a/src/google/protobuf/compiler/importer.cc
+++ b/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;