Skip to content

Commit

Permalink
fix empty line problem (#19171)
Browse files Browse the repository at this point in the history
  • Loading branch information
gemu2015 authored Jul 23, 2023
1 parent 547169c commit 994c105
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 994c105

Please sign in to comment.