diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2018-08-20 13:50:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-20 13:50:16 -0700 |
commit | fa252ec2a54acb24ddc87d48fed1ecfd458445fd (patch) | |
tree | 7e59167944c67457a08497ede5ae593a8fa0d369 | |
parent | 9590dd2c4f93f67ad42b2f1d6e4f312d61c54849 (diff) | |
parent | bf784289d280f9c85167c2fbe497ef0a5ec17568 (diff) | |
download | protobuf-fa252ec2a54acb24ddc87d48fed1ecfd458445fd.tar.gz protobuf-fa252ec2a54acb24ddc87d48fed1ecfd458445fd.tar.bz2 protobuf-fa252ec2a54acb24ddc87d48fed1ecfd458445fd.zip |
Merge pull request #5024 from greenhouse-org/fix-windows-path
Fix TryCreateParentDirectory on Windows
-rw-r--r-- | src/google/protobuf/compiler/command_line_interface.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index 842a1707..80056774 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -168,7 +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. - std::vector<string> parts = Split(filename, "/", true); + // On Windows, both '/' and '\' are valid path separators. + std::vector<string> parts = Split(filename, "/\\", true); string path_so_far = prefix; for (int i = 0; i < parts.size() - 1; i++) { path_so_far += parts[i]; |