diff --git a/src/frontend/mosh-server.cc b/src/frontend/mosh-server.cc index 21057e8..4aa6d5f 100644 --- a/src/frontend/mosh-server.cc +++ b/src/frontend/mosh-server.cc @@ -739,12 +739,11 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection & const Parser::Action &action = us.get_action( i ); if ( typeid( action ) == typeid( Parser::Resize ) ) { /* apply only the last consecutive Resize action */ - while ( i < us.size() - 1 ) { - const Parser::Action &next = us.get_action( i + 1 ); - if ( typeid( next ) != typeid( Parser::Resize ) ) { - break; + if ( i < us.size() - 1 ) { + const Parser::Action &next = us.get_action( i + 1 ); + if ( typeid( next ) == typeid( Parser::Resize ) ) { + continue; } - i++; } /* tell child process of resize */ const Parser::Resize &res = static_cast( action );