]> git.saurik.com Git - wxWidgets.git/commitdiff
fix assert in ANSI build in wxConsoleStderr::GetCommandHistory() (ticket 9146)
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 28 May 2008 12:47:27 +0000 (12:47 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 28 May 2008 12:47:27 +0000 (12:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/app.cpp

index 31ce0f4bb419ea49dc368297a395a5d7aac32be0..9c5011f73082b54c7bf55fdf31262ece985bbb1b 100644 (file)
@@ -477,7 +477,15 @@ int wxConsoleStderr::GetCommandHistory(wxWxCharBuffer& buf) const
     if ( len )
     {
         buf.extend(len);
-        const int len2 = m_pfnGetConsoleCommandHistory(buf.data(), len, CMD_EXE);
+
+        int len2 = m_pfnGetConsoleCommandHistory(buf.data(), len, CMD_EXE);
+
+#if !wxUSE_UNICODE
+        // there seems to be a bug in the GetConsoleCommandHistoryA(), it
+        // returns the length of Unicode string and not ANSI one
+        len2 /= 2;
+#endif // !wxUSE_UNICODE
+
         if ( len2 != len )
         {
             wxFAIL_MSG( _T("failed getting history?") );