diff options
author | WlodekM <[email protected]> | 2025-02-18 12:27:09 +0200 |
---|---|---|
committer | WlodekM <[email protected]> | 2025-02-18 12:27:09 +0200 |
commit | 3ff89680eb8e7309e879001de5b2d0f33e0cdae1 (patch) | |
tree | f21bd5d2a773f96bf259891d21fb04f8184aeb65 /progs/shel/shel.c | |
parent | 235001629adf67f173ae4db28eb42a301f9de878 (diff) |
uuuuuh wip hard drives thing
Diffstat (limited to 'progs/shel/shel.c')
-rw-r--r-- | progs/shel/shel.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/progs/shel/shel.c b/progs/shel/shel.c index f4292b6..323a06d 100644 --- a/progs/shel/shel.c +++ b/progs/shel/shel.c @@ -86,6 +86,9 @@ int main() { setenv("PATH", "/bin", 0); setenv("TERM", "xterm-256color", 1); setenv("TERMINFO", "/etc/smolsh", 1); + setenv("HOME", "/root", 1); + + strcpy(path, getenv("HOME")); while (!false) { memset(input, 0, sizeof(input)); @@ -162,7 +165,9 @@ int main() { } } if (found) { - execve(newPath, argv, 0); + extern char** environ; + setenv("CWD", path, 1); + execve(newPath, argv, environ); } } } else { |