finit.c: set _PATH_STDPATH much earlier
This should allow us to run 'prog' without
absolute paths.  Eg:
run("/bin/foo"); -> run("foo");
However we still need absolute PATH for
checking since fexist() need full path right now.
@@ -251,6 +251,11 @@ int main(int argc, char* argv[])
uev_init(&loop);
ctx = &loop;
+ /*
+ * Set the PATH early to something sane
+ */
+ setenv("PATH", _PATH_STDPATH, 1);
+
/*
* Mount base file system, kernel is assumed to run devtmpfs for /dev
*/
@@ -340,9 +345,6 @@ int main(int argc, char* argv[])
/* Set hostname as soon as possible, for syslog et al. */
set_hostname(&hostname);
- /* Set default PATH, for uid 0 */
- setenv("PATH", _PATH_STDPATH, 1);
-
/*
* Mount filesystems
*/
