1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-16 10:09:58 +00:00

Fix PATH reading

This commit is contained in:
Carles Fernandez 2019-03-03 13:39:55 +01:00
parent e7ea5c1fdd
commit 15a8bc9f3e
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -2082,7 +2082,7 @@ bool Gnuplot::get_program_path()
// Retrieves a C string containing the value of environment variable PATH
path = std::getenv("PATH");
std::stringstream s;
if (!path)
if (path != nullptr)
{
s << path;
}
@ -2091,10 +2091,8 @@ bool Gnuplot::get_program_path()
throw GnuplotException("PATH is not well defined");
}
std::string path_str;
if (s.gcount() > 0)
{
path_str = s.str();
}
path_str = s.str();
std::list<std::string> ls;
//split path (one long string) into list ls of strings