| @@ -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 | |
48 | std::string | | 48 | std::string |
49 | impl::get(const std::string& name) | | 49 | impl::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 | |
63 | bool | | 63 | bool |
64 | impl::has(const std::string& name) | | 64 | impl::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 | |
69 | void | | 69 | void |