aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorOliver Kiehl2003-08-28 19:46:52 +0000
committerOliver Kiehl2003-08-28 19:46:52 +0000
commit2a89cd9c9dda8693b34fa0391e8ec20cc2e14108 (patch)
tree775bd1cd403ca78d07d07cd626c84783966bbee0 /gui
parent898bbc85d0aa856c2f80a18acd3163cff59ebe63 (diff)
downloadscummvm-rg350-2a89cd9c9dda8693b34fa0391e8ec20cc2e14108.tar.gz
scummvm-rg350-2a89cd9c9dda8693b34fa0391e8ec20cc2e14108.tar.bz2
scummvm-rg350-2a89cd9c9dda8693b34fa0391e8ec20cc2e14108.zip
fix killLastWord
svn-id: r9896
Diffstat (limited to 'gui')
-rw-r--r--gui/console.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/gui/console.cpp b/gui/console.cpp
index 48a370c82c..a5c71dffc4 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -349,13 +349,16 @@ void ConsoleDialog::killLine() {
void ConsoleDialog::killLastWord() {
int pos;
int cnt = 0;
+ bool space = true;
while (_currentPos > _promptStartPos) {
- _currentPos--;
pos = getBufferPos();
- if (_buffer[pos] != ' ')
- cnt++;
- else
- break;
+ if (_buffer[pos-1] == ' ') {
+ if (!space)
+ break;
+ } else
+ space = false;
+ _currentPos--;
+ cnt++;
}
for (int i = _currentPos; i < _promptEndPos; i++)