1
0
forked from 0ad/0ad

Fix console history loading

This was SVN commit r7383.
This commit is contained in:
Ykkrosh 2010-03-20 22:01:39 +00:00
parent a8b3cc4812
commit 248749c1aa
2 changed files with 4 additions and 11 deletions

View File

@ -458,7 +458,7 @@ void CConsole::InsertChar(const int szChar, const wchar_t cooked )
}
if(!bad)
{
SetBuffer(L"%ls", m_deqBufHistory.at(iHistoryPos).c_str());
SetBuffer(m_deqBufHistory.at(iHistoryPos).c_str());
return;
}
}
@ -489,7 +489,7 @@ void CConsole::InsertChar(const int szChar, const wchar_t cooked )
}
if(!bad)
{
SetBuffer(L"%ls", m_deqBufHistory.at(iHistoryPos).c_str());
SetBuffer(m_deqBufHistory.at(iHistoryPos).c_str());
return;
}
}
@ -597,17 +597,10 @@ const wchar_t* CConsole::GetBuffer()
return( m_szBuffer );
}
void CConsole::SetBuffer(const wchar_t* szMessage, ...)
void CConsole::SetBuffer(const wchar_t* szMessage)
{
int oldBufferPos = m_iBufferPos; // remember since FlushBuffer will set it to 0
va_list args;
wchar_t szBuffer[CONSOLE_BUFFER_SIZE];
va_start(args, szMessage);
vswprintf(szBuffer, CONSOLE_BUFFER_SIZE, szMessage, args);
va_end(args);
FlushBuffer();
wcsncpy(m_szBuffer, szMessage, CONSOLE_BUFFER_SIZE);

View File

@ -61,7 +61,7 @@ public:
void SendChatMessage(const wchar_t *szMessage);
void ReceivedChatMessage(const wchar_t *pSender, const wchar_t *szMessage);
void SetBuffer(const wchar_t* szMessage, ...) WPRINTF_ARGS(2);
void SetBuffer(const wchar_t* szMessage);
void UseHistoryFile( const VfsPath& filename, int historysize );