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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Feb 1 19:18:21 CET 2010


Revision: 47801
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47801&view=rev
Author:   lordhoto
Date:     2010-02-01 18:18:20 +0000 (Mon, 01 Feb 2010)

Log Message:
-----------
Fix assert after ^W and Delete key events in the debugger, when there's nothing on the line.

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

Modified: scummvm/trunk/gui/console.cpp
===================================================================
--- scummvm/trunk/gui/console.cpp	2010-02-01 18:16:50 UTC (rev 47800)
+++ scummvm/trunk/gui/console.cpp	2010-02-01 18:18:20 UTC (rev 47801)
@@ -468,8 +468,10 @@
 void ConsoleDialog::killChar() {
 	for (int i = _currentPos; i < _promptEndPos; i++)
 		buffer(i) = buffer(i + 1);
-	buffer(_promptEndPos) = ' ';
-	_promptEndPos--;
+	if (_promptEndPos > _promptStartPos) {
+		buffer(_promptEndPos) = ' ';
+		_promptEndPos--;
+	}
 }
 
 void ConsoleDialog::killLine() {
@@ -493,8 +495,10 @@
 
 	for (int i = _currentPos; i < _promptEndPos; i++)
 		buffer(i) = buffer(i + cnt);
-	buffer(_promptEndPos) = ' ';
-	_promptEndPos -= cnt;
+	if (_promptEndPos > _promptStartPos) {
+		buffer(_promptEndPos) = ' ';
+		_promptEndPos -= cnt;
+	}
 }
 
 void ConsoleDialog::addToHistory(const char *str) {


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