mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Variables can be used under the [Variables] section (as long as they have been defined before the current variable is read).
This commit is contained in:
parent
1d1290e3fa
commit
122fb8f90f
@ -124,37 +124,18 @@ void CConfigParser::ReadVariables()
|
|||||||
|
|
||||||
if (size > 0)
|
if (size > 0)
|
||||||
{
|
{
|
||||||
variable = new TCHAR[bufferSize];
|
|
||||||
|
|
||||||
// Read all variables
|
// Read all variables
|
||||||
WCHAR* pos = buffer;
|
WCHAR* pos = buffer;
|
||||||
while(wcslen(pos) > 0)
|
while(wcslen(pos) > 0)
|
||||||
{
|
{
|
||||||
do
|
std::wstring variable = ReadString(L"Variables", pos, L"");
|
||||||
{
|
if (!variable.empty())
|
||||||
loop = false;
|
|
||||||
size = GetPrivateProfileString(L"Variables", pos, L"", variable, bufferSize, m_Filename.c_str());
|
|
||||||
|
|
||||||
if (size == bufferSize - 1)
|
|
||||||
{
|
|
||||||
// Buffer too small, increase it and retry
|
|
||||||
delete [] variable;
|
|
||||||
bufferSize *= 2;
|
|
||||||
variable = new TCHAR[bufferSize];
|
|
||||||
loop = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
} while(loop);
|
|
||||||
|
|
||||||
if (wcslen(variable) > 0)
|
|
||||||
{
|
{
|
||||||
m_Variables[pos] = variable;
|
m_Variables[pos] = variable;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = pos + wcslen(pos) + 1;
|
pos = pos + wcslen(pos) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] variable;
|
|
||||||
}
|
}
|
||||||
delete [] buffer;
|
delete [] buffer;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user