Permalink
Browse files

Set the SHELL environment variable with the full path of the shell ex…

…ecutable
  • Loading branch information...
1 parent 76dcc74 commit b7cf63d0caebc4f80edd65d590cd75e397c9467c @jmstacey committed Mar 1, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/thsh.c
View
@@ -127,9 +127,14 @@ int main(int argc, char *argv[], char *envp[])
char input[CHAR_BUFFER];
char *arguments[MAX_ARGS];
+ char shell_path[BUFSIZ];
+ // Initialize shell
set_pwd(); // Update the current working directory
+ readlink("/proc/self/exe", shell_path, BUFSIZ);
+ setenv("SHELL", shell_path, 1);
+ // Main run loop
while (1)
{
print_prompt();

0 comments on commit b7cf63d

Please sign in to comment.