Allow escaped spaces in wifi ssid serial console

This commit is contained in:
suchmememanyskill
2024-08-14 23:06:46 +02:00
parent 6ebaf68cf1
commit db019939a6

View File

@@ -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)
{
@@ -100,8 +100,12 @@ namespace serial_console
index++;
}
else
{
if (input[index] != '\\')
{
word += input[index];
}
index++;
}
} while (1);