Thu Apr 23 16:05:16 2020 UTC ()
Add the system binary paths too since tests use them.


(christos)
diff -r1.3 -r1.4 src/external/bsd/atf/dist/tools/env.cpp

cvs diff -r1.3 -r1.4 src/external/bsd/atf/dist/tools/env.cpp (expand / switch to unified diff)

--- src/external/bsd/atf/dist/tools/env.cpp 2020/03/31 01:02:18 1.3
+++ src/external/bsd/atf/dist/tools/env.cpp 2020/04/23 16:05:15 1.4
@@ -43,27 +43,27 @@ namespace impl = tools::env; @@ -43,27 +43,27 @@ namespace impl = tools::env;
43 43
44// ------------------------------------------------------------------------ 44// ------------------------------------------------------------------------
45// Free functions. 45// Free functions.
46// ------------------------------------------------------------------------ 46// ------------------------------------------------------------------------
47 47
48std::string 48std::string
49impl::get(const std::string& name) 49impl::get(const std::string& name)
50{ 50{
51 const char *n =name.c_str(); 51 const char *n =name.c_str();
52 const char* val = getenv(n); 52 const char* val = getenv(n);
53 if (val != NULL) 53 if (val != NULL)
54 return val; 54 return val;
55 if (strcmp(n, "PATH") == 0) 55 if (strcmp(n, "PATH") == 0)
56 return "/bin:/usr/bin"; 56 return "/bin:/usr/bin:/sbin:/usr/sbin";
57  57
58 throw tools::system_error(IMPL_NAME "::set", 58 throw tools::system_error(IMPL_NAME "::set",
59 "Cannot get environment variable '" + name + 59 "Cannot get environment variable '" + name +
60 "'", errno); 60 "'", errno);
61} 61}
62 62
63bool 63bool
64impl::has(const std::string& name) 64impl::has(const std::string& name)
65{ 65{
66 return getenv(name.c_str()) != NULL; 66 return getenv(name.c_str()) != NULL;
67} 67}
68 68
69void 69void