* main.c (OS_Setup): Fixed segmentation fault.

From Oskar Liljeblad <oskar osk.mine.nu>
This commit is contained in:
Roland Illig 2004-09-23 14:07:44 +00:00
parent 8f2dfbb70e
commit ff7a776535
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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";