--- python.c-r1 2009-08-08 12:13:27.903070452 -0400 +++ python.c 2009-08-08 12:20:36.693138752 -0400 @@ -33,7 +33,15 @@ const char* find_path(const char* exe) { return strndup(exe, last_slash - exe); } - char* path = strdup(getenv("PATH")); + const char* PATH = getenv("PATH"); + if (!PATH) + { + /* If PATH is unset, then it defaults to ":/bin:/usr/bin", per + * execvp(3). + */ + PATH = ":/bin:/usr/bin" + } + char* path = strdup(PATH); char* state; const char* token = strtok_r(path, ":", &state); while (token)