Fix (not) asking to make sure to flash in scripts

This commit is contained in:
Such Meme, Many Skill
2020-05-08 20:57:26 +02:00
parent 73ca98c6a8
commit 19fe7f15a9
5 changed files with 17 additions and 9 deletions

View File

@@ -73,6 +73,7 @@ int ini_parse(link_t *dst, char *ini_path, bool is_dir)
char *filelist = NULL;
FIL fp;
ini_sec_t *csec = NULL;
bool firstIniRun = true;
char *filename = (char *)malloc(256);
@@ -116,10 +117,17 @@ int ini_parse(link_t *dst, char *ini_path, bool is_dir)
do
{
if (firstIniRun){
firstIniRun = false;
strcpy(lbuf, "[Unknown]");
lblen = 9;
}
else {
// Fetch one line.
lbuf[0] = 0;
f_gets(lbuf, 512, &fp);
lblen = strlen(lbuf);
}
// Remove trailing newline. Depends on 'FF_USE_STRFUNC 2' that removes \r.
if (lblen && lbuf[lblen - 1] == '\n')