diff --git a/source/ps/CConsole.cpp b/source/ps/CConsole.cpp index 5f481a3e6d..9fe86f101f 100755 --- a/source/ps/CConsole.cpp +++ b/source/ps/CConsole.cpp @@ -377,19 +377,68 @@ void CConsole::InsertChar(const int szChar, const wchar_t cooked ) // BEGIN: Buffer History Lookup case SDLK_UP: - if (m_deqBufHistory.size() && iHistoryPos != (int)m_deqBufHistory.size() - 1) + if ( m_deqBufHistory.size() ) { - iHistoryPos++; - SetBuffer(m_deqBufHistory.at(iHistoryPos).data()); + int oldHistoryPos = iHistoryPos; + while( iHistoryPos != (int)m_deqBufHistory.size() - 1) + { + iHistoryPos++; + std::wstring& histString = m_deqBufHistory.at(iHistoryPos); + if(histString.length() >= m_iBufferPos) + { + bool bad = false; + for(int i=0; i= m_iBufferPos) + { + bool bad = false; + for(int i=0; i