X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=init.c;h=ff02dce9fa90ff6ea9670be941522f322af5c0f1;hp=2999e7e5e9d86e2f7025a64fac207a60af84c1b4;hb=b6980caf7b13994c57957872876cdecc21e54a82;hpb=82f35ae0a006c52d0f6e3c5e09fdac5d16cddaf3 diff --git a/init.c b/init.c index 2999e7e..ff02dce 100644 --- a/init.c +++ b/init.c @@ -11,7 +11,6 @@ */ #include -#include #include #include @@ -2142,7 +2141,6 @@ static int mutt_execute_commands (string_list_t * p) void mutt_init (int skip_sys_rc, string_list_t * commands) { struct passwd *pw; - struct utsname utsname; const char *p; char buffer[STRING], error[STRING]; int default_rc = 0, need_pause = 0; @@ -2172,27 +2170,6 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) Realname = m_strdup(rnbuf); } - /* And about the host... */ - uname (&utsname); - /* some systems report the FQDN instead of just the hostname */ - if ((p = strchr (utsname.nodename, '.'))) { - Hostname = p_dupstr(utsname.nodename, p - utsname.nodename); - p++; - m_strcpy(buffer, sizeof(buffer), p); /* save the domain for below */ - } - else - Hostname = m_strdup(utsname.nodename); - - if (!p && getdnsdomainname(buffer, sizeof(buffer)) == -1) - Fqdn = m_strdup("@"); - else - if (*buffer != '@') { - Fqdn = p_new(char, m_strlen(buffer) + m_strlen(Hostname) + 2); - sprintf (Fqdn, "%s.%s", NONULL(Hostname), buffer); - } - else - Fqdn = m_strdup(NONULL (Hostname)); - #ifdef USE_NNTP { FILE *f; @@ -2214,11 +2191,9 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) NewsServer = m_strdup(p); #endif - if ((p = getenv ("MAIL"))) - Spoolfile = m_strdup(p); - else if ((p = getenv ("MAILDIR"))) + if ((p = getenv("MAIL") ?: getenv("MAILDIR"))) { Spoolfile = m_strdup(p); - else { + } else { #ifdef HOMESPOOL mutt_concat_path(buffer, sizeof(buffer), NONULL(MCore.homedir), MAILPATH); #else