aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/command_line_interface.cc
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xiaofeng@google.com>2016-06-08 14:43:45 -0700
committerGravatar Feng Xiao <xiaofeng@google.com>2016-06-08 14:43:45 -0700
commitfba7976f5d6f1be69d4219a7c485c93b8b28bf65 (patch)
tree3bec3f3a094e55d20070e6dd6a1450346c311418 /src/google/protobuf/compiler/command_line_interface.cc
parent401e07d3726e91659228dff8ed9f7cb02026c47e (diff)
parent462e7fab9831c026acbb38778f4506fcfdb2d945 (diff)
Merge pull request #879 from mathstuf/support-equals-in-proto-path
protoc: support '=' in --proto_path arguments
Diffstat (limited to 'src/google/protobuf/compiler/command_line_interface.cc')
-rw-r--r--src/google/protobuf/compiler/command_line_interface.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc
index fcad6b61..c1a6c15d 100644
--- a/src/google/protobuf/compiler/command_line_interface.cc
+++ b/src/google/protobuf/compiler/command_line_interface.cc
@@ -1136,8 +1136,13 @@ CommandLineInterface::InterpretArgument(const string& name,
// Make sure disk path exists, warn otherwise.
if (access(disk_path.c_str(), F_OK) < 0) {
- std::cerr << disk_path << ": warning: directory does not exist."
- << std::endl;
+ // Try the original path; it may have just happed to have a '=' in it.
+ if (access(parts[i].c_str(), F_OK) < 0) {
+ cerr << disk_path << ": warning: directory does not exist." << endl;
+ } else {
+ virtual_path = "";
+ disk_path = parts[i];
+ }
}
// Don't use make_pair as the old/default standard library on Solaris