Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix empty line problem #19171

Merged
merged 1 commit into from
Jul 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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