From 994c105bdaa4e55ef62add32da30af0bc74f15dc Mon Sep 17 00:00:00 2001 From: gemu Date: Sun, 23 Jul 2023 11:55:01 +0200 Subject: [PATCH] fix empty line problem (#19171) --- .../tasmota_xdrv_driver/xdrv_10_scripter.ino | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino index ac24a6a9a2e0..54922adf9695 100755 --- a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino @@ -3807,6 +3807,13 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value); SCRIPT_SKIP_SPACES lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES + char delimc = 0; + if (*lp != ')') { + // get delimiter + delimc = *lp; + lp++; + } + char rstring[SCRIPT_MAXSSIZE]; rstring[0] = 0; int8_t index = fvar; @@ -3857,6 +3864,12 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value); break; } } + if (delimc) { + char *xp = strchr(rstring, delimc); + if (xp) { + *xp = 0; + } + } free(mqd); } } @@ -6803,6 +6816,11 @@ startline: } // skip empty line SCRIPT_SKIP_EOL + + while (*lp == '\t' || *lp == ' ') { + lp++; + } + // skip comment if (*lp == ';') goto next_line; if (!*lp) break;