Merge pull request #50 from VexFlint/fix/linux-console-crlf

Accept CRLF lines on the Linux server console
This commit is contained in:
zeex64 authored and GitHub committed 2026-10-05 16:58:49 -05:00
commit e877af0620
1 file changed
+3
+3
View File
@@ -191,6 +191,9 @@ struct Input {
}
for (ssize_t i = 0; i < count; ++i) {
if (buffer[i] == '\n') {
// CRLF input (a script saved on Windows, a panel or telnet): without
// this, "quit\r" is an unknown command and the server keeps running.
if (!pending.empty() && pending.back() == '\r') pending.pop_back();
std::lock_guard lock(mutex);
lines.push_back(pending);
pending.clear();