Allow env - atf-run to work by setting a default minimal path.
This commit is contained in:
parent
acf9dc2f4e
commit
677813249d
|
@ -48,9 +48,16 @@ namespace impl = tools::env;
|
|||
std::string
|
||||
impl::get(const std::string& name)
|
||||
{
|
||||
const char* val = getenv(name.c_str());
|
||||
assert(val != NULL);
|
||||
return val;
|
||||
const char *n =name.c_str();
|
||||
const char* val = getenv(n);
|
||||
if (val != NULL)
|
||||
return val;
|
||||
if (strcmp(n, "PATH") == 0)
|
||||
return "/bin:/usr/bin";
|
||||
|
||||
throw tools::system_error(IMPL_NAME "::set",
|
||||
"Cannot get environment variable '" + name +
|
||||
"'", errno);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
Loading…
Reference in New Issue