From db019939a695bf860993a192b9b1fde51f1bbc33 Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Wed, 14 Aug 2024 23:06:46 +0200 Subject: [PATCH] Allow escaped spaces in wifi ssid serial console --- CYD-Klipper/src/ui/serial/serial_console.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CYD-Klipper/src/ui/serial/serial_console.cpp b/CYD-Klipper/src/ui/serial/serial_console.cpp index e688147..dc55551 100644 --- a/CYD-Klipper/src/ui/serial/serial_console.cpp +++ b/CYD-Klipper/src/ui/serial/serial_console.cpp @@ -80,7 +80,7 @@ namespace serial_console String word = ""; do { - if (input[index] == '\t' || input[index] == ' ' || input[index] == '\n' || input[index] == '\r' || input[index] == '\0') + if (input[index] == '\t' || (input[index] == ' ' && (index <= 0 || input[index - 1] != '\\')) || input[index] == '\n' || input[index] == '\r' || input[index] == '\0') { if (word.length() > 0) { @@ -101,7 +101,11 @@ namespace serial_console } else { - word += input[index]; + if (input[index] != '\\') + { + word += input[index]; + } + index++; } } while (1);