--- rxvt-unicode/src/logging.C 2006/01/17 10:14:26 1.27 +++ rxvt-unicode/src/logging.C 2006/01/17 10:19:13 1.28 @@ -59,11 +59,14 @@ void rxvt_ptytty::login (int cmd_pid, bool login_shell, const char *hostname) { + const char *pty = name; + + if (!pty || !*pty) + return; + this->cmd_pid = cmd_pid; this->login_shell = login_shell; - const char *pty = name; - #ifdef HAVE_STRUCT_UTMP struct utmp *ut = &this->ut; #endif @@ -226,6 +229,9 @@ void rxvt_ptytty::logout () { + if (!cmd_pid) + return; + #ifdef HAVE_STRUCT_UTMP struct utmp *tmput, *ut = &this->ut; #endif @@ -305,6 +311,8 @@ pututxline (utx); endutxent (); #endif + + cmd_pid = 0; } /* ------------------------------------------------------------------------- */