mirror of
https://github.com/Alcaro/Flips.git
synced 2026-09-07 10:06:09 -05:00
Allow removing things from this config. Still a ridiculously inefficient solution, of course.
This commit is contained in:
@@ -251,7 +251,7 @@ void config::set(LPCWSTR name, LPCWSTR value)
|
||||
if (!wcscmp(name, this->names[i]))
|
||||
{
|
||||
free(this->values[i]);
|
||||
this->values[i] = wcsdup(value);
|
||||
this->values[i] = (value!=NULL ? wcsdup(value) : NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -292,7 +292,10 @@ LPWSTR config::flatten()
|
||||
at += wsprintf(at, "%s", header);
|
||||
for (size_t i=0;i<this->numentries;i++)
|
||||
{
|
||||
at += wsprintf(at, "%s=%s\n", this->names[i], this->values[i]);
|
||||
if (this->values[i]!=NULL)
|
||||
{
|
||||
at += wsprintf(at, "%s=%s\n", this->names[i], this->values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user