From 32cd2d69b9ce7bceed16c2f7ac35ed9f300f7965 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 5 Feb 2016 18:19:06 +0100 Subject: [PATCH] Make autocompletion of LuaConsole not crash --- ext/ghoul | 2 +- src/interaction/luaconsole.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 57b2840dea..d04752c87d 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 57b2840dea5ba881d0da21890e48592b74b951bd +Subproject commit d04752c87df2d7e391a3b5ef1606ed640990b0b7 diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp index e8890c983b..07ac2fc066 100644 --- a/src/interaction/luaconsole.cpp +++ b/src/interaction/luaconsole.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -221,7 +222,7 @@ void LuaConsole::keyboardCallback(Key key, KeyModifier modifier, KeyAction actio std::string commandLowerCase; std::transform( command.begin(), command.end(), - commandLowerCase.begin(), + std::back_inserter(commandLowerCase), ::tolower ); @@ -229,7 +230,7 @@ void LuaConsole::keyboardCallback(Key key, KeyModifier modifier, KeyAction actio std::transform( _autoCompleteInfo.initialValue.begin(), _autoCompleteInfo.initialValue.end(), - initialValueLowerCase.begin(), + std::back_inserter(initialValueLowerCase), ::tolower );