mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2025-04-01 23:32:59 +00:00
use _PATH_DEFPATH if $PATH is null.
This commit is contained in:
parent
56b0c93fd7
commit
fafb08b90a
@ -28,6 +28,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <sysexits.h>
|
||||
#include <paths.h>
|
||||
|
||||
namespace fs = filesystem;
|
||||
|
||||
@ -368,8 +369,9 @@ fs::path mpw_path() {
|
||||
|
||||
if (path.empty()) {
|
||||
std::error_code ec;
|
||||
|
||||
std::string s(getenv("PATH"));
|
||||
const char *cp = getenv("PATH");
|
||||
if (!cp) cp = _PATH_DEFPATH;
|
||||
std::string s(cp);
|
||||
string_splitter ss(s, ':');
|
||||
for (; ss; ++ss) {
|
||||
if (ss->empty()) continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user