[Scummvm-cvs-logs] SF.net SVN: scummvm:[42597] scummvm/trunk/gui/debugger.cpp

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Sun Jul 19 00:17:58 CEST 2009


Revision: 42597
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42597&view=rev
Author:   wjpalenstijn
Date:     2009-07-18 22:17:56 +0000 (Sat, 18 Jul 2009)

Log Message:
-----------
Fix crash in tab completion if one command is a prefix of another.

Modified Paths:
--------------
    scummvm/trunk/gui/debugger.cpp

Modified: scummvm/trunk/gui/debugger.cpp
===================================================================
--- scummvm/trunk/gui/debugger.cpp	2009-07-18 21:26:44 UTC (rev 42596)
+++ scummvm/trunk/gui/debugger.cpp	2009-07-18 22:17:56 UTC (rev 42597)
@@ -307,7 +307,8 @@
 				} else {
 					// take common prefix of previous match and this command
 					for (uint j = 0; j < completion.size(); j++) {
-						if (completion[j] != i->_key[inputlen + j]) {
+						if (inputlen + j >= i->_key.size() ||
+								completion[j] != i->_key[inputlen + j]) {
 							completion = Common::String(completion.begin(), completion.begin() + j);
 							// If there is no unambiguous completion, abort
 							if (completion.empty())


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list