We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 287346c commit 9264902Copy full SHA for 9264902
roottest/root/meta/countIncludePaths.C
@@ -19,8 +19,13 @@ int countIncludePaths()
19
20
// count paths coming from the ROOT_INCLUDE_PATH environment variable
21
// and exclude them
22
- std::string envVar(std::getenv("ROOT_INCLUDE_PATH"));
23
- auto nEnvVarPaths = countSubstring(envVar, ":") + 1 - (envVar.back() == ':') - (envVar.front() == ':') ;
+ int nEnvVarPaths = 0;
+ auto *envVarCStr = std::getenv("ROOT_INCLUDE_PATH");
24
+ if (envVarCStr) {
25
+ std::string envVar(envVarCStr);
26
+ nEnvVarPaths =
27
+ countSubstring(envVar, ":") + 1 - (envVar.back() == ':') - (envVar.front() == ':');
28
+ }
29
30
// At most 10
31
auto nPaths = countSubstring(includePath, "-I");
0 commit comments