diff --git a/modules/shell.cpp b/modules/shell.cpp index ab4c3b8f..d4871df4 100644 --- a/modules/shell.cpp +++ b/modules/shell.cpp @@ -166,6 +166,12 @@ void CShellSock::ReadLine(const CString& sData) { } void CShellSock::Disconnected() { + // If there is some incomplete line in the buffer, read it + // (e.g. echo echo -n "hi" triggered this) + CString &sBuffer = GetInternalBuffer(); + if (!sBuffer.empty()) + ReadLine(sBuffer); + m_pParent->SetClient(m_pClient); m_pParent->PutShell("znc$"); m_pParent->SetClient(NULL);