Actually check that PATH is set before trying to use it

This commit is contained in:
K. Lange 2021-05-06 19:33:39 +09:00
parent 0c0b8c98e7
commit bd7102a2f0

View File

@ -668,7 +668,9 @@ static void findInterpreter(char * argv[]) {
binpath = realpath(argv[0], tmp);
} else {
/* Search PATH for argv[0] */
char * _path = strdup(getenv("PATH"));
char * p = getenv("PATH");
if (!p) return;
char * _path = strdup(p);
char * path = _path;
while (path) {
char * next = strchr(path,':');