Skip to content

Commit

Permalink
Detached warning: Omit spurious utmp entries (generated by screen)
Browse files Browse the repository at this point in the history
  • Loading branch information
keithw committed Mar 10, 2013
1 parent a54e6d1 commit 093bbc9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/frontend/mosh-server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,9 @@ void warn_unattached( const string & ignore_entry )
&& (username == string( entry->ut_user )) ) {
/* does line show unattached mosh session */
string text( entry->ut_host );
if ( (text.substr( 0, 5 ) == "mosh ")
if ( (text.size() >= 5)
&& (text.substr( 0, 5 ) == "mosh ")
&& (text[ text.size() - 1 ] == ']')
&& (text != ignore_entry)
&& device_exists( entry->ut_line ) ) {
unattached_mosh_servers.push_back( text );
Expand Down

0 comments on commit 093bbc9

Please sign in to comment.