Settings: fix storage of screens in htoprc

This commit is contained in:
Hisham Muhammad 2018-08-24 18:04:23 -03:00
parent 0939e5cb41
commit 28a5859fe8
1 changed files with 2 additions and 0 deletions

View File

@ -361,6 +361,7 @@ static bool Settings_read(Settings* this, const char* fileName) {
didReadMeters = true;
} else if (strncmp(option[0], "screen:", 7) == 0) {
Settings_newScreen(this, option[0] + 7, option[1]);
didReadFields = true;
} else if (String_eq(option[0], ".tree_view")) {
if (this->nScreens > 0) {
this->screens[this->nScreens - 1]->treeView = atoi(option[1]);
@ -380,6 +381,7 @@ static bool Settings_read(Settings* this, const char* fileName) {
if (this->nScreens == 0) {
Settings_defaultScreens(this);
if (legacyFieldsRead) {
didReadFields = true;
free(this->screens[0]->fields);
this->screens[0]->fields = legacyFields;
this->screens[0]->flags = legacyFlags;