Bläddra i källkod

Replace "\\" with "/" for windows path names.

Feng Xiao 10 år sedan
förälder
incheckning
b11d6fe515
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4 0
      src/google/protobuf/testing/googletest.cc

+ 4 - 0
src/google/protobuf/testing/googletest.cc

@@ -108,6 +108,10 @@ string GetTemporaryDirectoryName() {
   if (HasPrefixString(result, "\\")) {
   if (HasPrefixString(result, "\\")) {
     result.erase(0, 1);
     result.erase(0, 1);
   }
   }
+  // The Win32 API accepts forward slashes as a path delimiter even though
+  // backslashes are standard.  Let's avoid confusion and use only forward
+  // slashes.
+  result = StringReplace(result, "\\", "/", true);
 #endif  // _WIN32
 #endif  // _WIN32
   return result;
   return result;
 }
 }