Run $SHELL on terminal startup instead of hard-coded /bin/sh

This commit is contained in:
Kevin Lange 2014-08-26 21:37:45 -07:00
parent 9cc5ddd0e9
commit a0a6ece24d
2 changed files with 6 additions and 2 deletions

View File

@ -699,7 +699,9 @@ int main(int argc, char ** argv) {
char * tokens[] = {"/bin/login",NULL};
int i = execvp(tokens[0], tokens);
} else {
char * tokens[] = {"/bin/sh",NULL};
char * shell = getenv("SHELL");
if (!shell) shell = "/bin/sh"; /* fallback */
char * tokens[] = {shell,NULL};
int i = execvp(tokens[0], tokens);
}
}

View File

@ -1311,7 +1311,9 @@ int main(int argc, char ** argv) {
char * tokens[] = {"/bin/login",NULL};
int i = execvp(tokens[0], tokens);
} else {
char * tokens[] = {"/bin/sh",NULL};
char * shell = getenv("SHELL");
if (!shell) shell = "/bin/sh"; /* fallback */
char * tokens[] = {shell,NULL};
int i = execvp(tokens[0], tokens);
}
}