Merge pull request #470 from kohlerm/master

improving shell detection
This commit is contained in:
jelle van der Waa 2017-07-08 21:37:29 +02:00 committed by GitHub
commit d87e7c8269
1 changed files with 8 additions and 4 deletions

View File

@ -1519,11 +1519,15 @@ static void exit_with_success(VteTerminal *) {
}
static char *get_user_shell_with_fallback() {
if (const char *env = g_getenv("SHELL"))
return g_strdup(env);
if (const char *env = g_getenv("SHELL") ) {
if (!((env != NULL) && (env[0] == '\0')))
return g_strdup(env);
}
if (char *command = vte_get_user_shell())
return command;
if (char *command = vte_get_user_shell()) {
if (!((command != NULL) && (command[0] == '\0')))
return command;
}
return g_strdup("/bin/sh");
}