File: fix-default-proto-file-path.patch

package info (click to toggle)
opentelemetry-cpp 1.23.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,368 kB
  • sloc: cpp: 96,239; sh: 1,766; makefile: 38; python: 31
file content (20 lines) | stat: -rw-r--r-- 826 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc
index f192ae6..22900ed 100644
--- a/src/google/protobuf/compiler/command_line_interface.cc
+++ b/src/google/protobuf/compiler/command_line_interface.cc
@@ -260,11 +260,15 @@ void AddDefaultProtoPaths(
     return;
   }
   // Check if the upper level directory has an "include" subdirectory.
+  // change "'$/bin' is next to 'include'" assumption to "'$/bin/tools' is next to 'include'"
+  for (int i = 0; i < 2; i++)
+  {
   pos = path.find_last_of("/\\");
   if (pos == std::string::npos || pos == 0) {
     return;
   }
   path = path.substr(0, pos);
+  }
   if (IsInstalledProtoPath(path + "/include")) {
     paths->push_back(
         std::pair<std::string, std::string>("", path + "/include"));