[Server] Handle backspace input if the current line is empty

This commit is contained in:
uramer 2020-03-02 14:40:00 +01:00
parent 59693abc74
commit 2b71cbb8fc

View File

@ -19,7 +19,9 @@ namespace mwmp_input {
windowInputBuffer.assign("");
}
else if (c == '\b') {
windowInputBuffer.erase(windowInputBuffer.size() - 1);
auto size = windowInputBuffer.size();
if (size > 0)
windowInputBuffer.erase(size - 1);
}
else windowInputBuffer += c;
}