Skip to content
Snippets Groups Projects
Commit b4aca829 authored by Marco Clemencic's avatar Marco Clemencic Committed by Andre Sailer
Browse files

Check if the env variable is set before trying to use it

parent a22179bd
No related branches found
No related tags found
No related merge requests found
...@@ -156,7 +156,9 @@ namespace Gaudi { ...@@ -156,7 +156,9 @@ namespace Gaudi {
std::regex line_format{"^(?:[[:space:]]*(?:(v[0-9]+)::)?([^:]+):(.*[^[:space:]]))?[[:space:]]*(?:#.*)?$"}; std::regex line_format{"^(?:[[:space:]]*(?:(v[0-9]+)::)?([^:]+):(.*[^[:space:]]))?[[:space:]]*(?:#.*)?$"};
std::smatch matches; std::smatch matches;
std::string search_path = std::getenv( envVar.c_str() ); std::string search_path;
const char* envPtr = std::getenv( envVar.c_str() );
if ( envPtr ) search_path = envPtr;
if ( search_path.empty() ) { if ( search_path.empty() ) {
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment