Parcourir la source

Always spilt on '\' and '/'

Sam Smith il y a 7 ans
Parent
commit
bf784289d2
1 fichiers modifiés avec 1 ajouts et 5 suppressions
  1. 1 5
      src/google/protobuf/compiler/command_line_interface.cc

+ 1 - 5
src/google/protobuf/compiler/command_line_interface.cc

@@ -168,12 +168,8 @@ bool VerifyDirectoryExists(const string& path) {
 // directories listed in |filename|.
 bool TryCreateParentDirectory(const string& prefix, const string& filename) {
   // Recursively create parent directories to the output file.
-#if defined(_WIN32)
-  // on Windows, both '/' and '\' are valid path separators
+  // On Windows, both '/' and '\' are valid path separators.
   std::vector<string> parts = Split(filename, "/\\", true);
-#else
-  std::vector<string> parts = Split(filename, "/", true);
-#endif
   string path_so_far = prefix;
   for (int i = 0; i < parts.size() - 1; i++) {
     path_so_far += parts[i];