Fix clearing the default environment

This commit is contained in:
Maschell 2022-01-03 19:00:35 +01:00
parent 9b86283cfd
commit fb5f06064e

View File

@ -359,14 +359,18 @@ std::string EnvironmentSelectionScreen(const std::map<std::string, std::string>
free(screenBuffer); free(screenBuffer);
if (autoBoot != autobootIndex) { if (autoBoot != autobootIndex) {
int i = 0; if (autoBoot == -1) {
for (auto const&[key, val]: payloads) { writeFileContent(AUTOBOOT_CONFIG_PATH, "-1");
if (i == autoBoot) { } else {
DEBUG_FUNCTION_LINE("Save config"); int i = 0;
writeFileContent(AUTOBOOT_CONFIG_PATH, key); for (auto const&[key, val]: payloads) {
break; if (i == autoBoot) {
DEBUG_FUNCTION_LINE("Save config");
writeFileContent(AUTOBOOT_CONFIG_PATH, key);
break;
}
i++;
} }
i++;
} }
} }