Skip to content

Commit

Permalink
ConfigParser: Fixed issue with @ Include insertion position during re…
Browse files Browse the repository at this point in the history
…cursive loading of ini files

Previously, the insertion position of sections was not reset to the correct position when returning from a recursive call.

For more info, see here:
https://forum.rainmeter.net/viewtopic.php?t=44016
  • Loading branch information
brianferguson committed Jul 22, 2024
1 parent 6c931ae commit 7c05ffe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Library/ConfigParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,13 @@ void ConfigParser::ReadIniFile(const std::wstring& iniFile, LPCTSTR skinSection,
}
}

// Save the section insertion position in case the included file also uses an @Include
std::list<std::wstring>::const_iterator prevInsertPos = m_SectionInsertPos;

ReadIniFile(value, skinSection, depth + 1);

// Reset the section insertion position to previous position
m_SectionInsertPos = prevInsertPos;
}
}
else
Expand Down

0 comments on commit 7c05ffe

Please sign in to comment.