mirror of https://github.com/MidnightCommander/mc
* main.c (OS_Setup): Fixed segmentation fault.
From Oskar Liljeblad <oskar osk.mine.nu>
This commit is contained in:
parent
8f2dfbb70e
commit
ff7a776535
|
@ -1,3 +1,9 @@
|
|||
2004-09-23 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* main.c (OS_Setup): Fixed segmentation fault.
|
||||
|
||||
From Oskar Liljeblad <oskar osk.mine.nu>
|
||||
|
||||
2004-09-21 Leonard den Ottolander <leonard * den ottolander nl>
|
||||
|
||||
* filegui.c (file_mask_dialog): Expand tilde. Remove redundant
|
||||
|
|
|
@ -1765,8 +1765,12 @@ OS_Setup (void)
|
|||
{
|
||||
char *mc_libdir;
|
||||
shell = getenv ("SHELL");
|
||||
if (!shell || !*shell)
|
||||
shell = g_strdup (getpwuid (geteuid ())->pw_shell);
|
||||
if (!shell || !*shell) {
|
||||
struct passwd *pwd;
|
||||
pwd = getpwuid (geteuid ());
|
||||
if (pwd != NULL)
|
||||
shell = g_strdup (pwd->pw_shell);
|
||||
}
|
||||
if (!shell || !*shell)
|
||||
shell = "/bin/sh";
|
||||
|
||||
|
|
Loading…
Reference in New Issue