Fix getenv(SHELL)
This commit is contained in:
parent
32f08816be
commit
4014407a34
1 changed files with 16 additions and 15 deletions
7
ccc.c
7
ccc.c
|
@ -1304,10 +1304,12 @@ void start_shell(void)
|
|||
bprintf("\033[2J\033[?25h");
|
||||
move_cursor(1, 1);
|
||||
char shell[PATH_MAX];
|
||||
strcpy(shell, getenv("SHELL"));
|
||||
if (strlen(shell) == 0) {
|
||||
char *shellenv = getenv("SHELL");
|
||||
if (!shellenv) {
|
||||
strcpy(shell, "sh");
|
||||
} else {
|
||||
strcpy(shell, shellenv);
|
||||
}
|
||||
pid_t pid = fork();
|
||||
if (pid == 0) {
|
||||
/* Child process */
|
||||
|
@ -1322,7 +1324,6 @@ void start_shell(void)
|
|||
wpprintw("fork failed: %s", strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void yank_clipboard(void)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue