From 093bbc9111cb4a4e6f4e20c68cc3ea8243f12fc6 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Sun, 10 Mar 2013 16:31:37 -0400 Subject: [PATCH] Detached warning: Omit spurious utmp entries (generated by screen) --- src/frontend/mosh-server.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/mosh-server.cc b/src/frontend/mosh-server.cc index 600ab90..ae2505f 100644 --- a/src/frontend/mosh-server.cc +++ b/src/frontend/mosh-server.cc @@ -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 );